code: def amp_to_db(
      *, x: np.ndarray = None, gain: float = 1, base: int = 10, **kwargs
  ) -> np.ndarray:
      """Convert amplitude values to decibels.
  
      Args:
          x (np.ndarray): Amplitude spectrogram.
          gain (float): Gain factor. Defaults to 1.
          base (int): Logarithm base. Defaults to 10.
  
      Returns:
          np.ndarray: Decibels spectrogram.
      """
      assert (
          x < 0
      ).sum() == 0, " [!] Input values must be non-negative."
      return gain * _log(np.maximum(1e-8, x), base)
  
imports: from io import BytesIO
  from typing import Tuple
  import librosa
  import numpy
  import scipy
  import soundfile
  from librosa import magphase, pyin
label_desc: Use image node_id 5 for calling a global function with example usage: amp_to_db() and returns: unknown