code: def wav_to_spec(*, wav: np.ndarray = None, **kwargs) -> np.ndarray:
      """Compute a spectrogram from a waveform.
  
      Args:
          wav (np.ndarray): Waveform. Shape :math:`[T_wav,]`
  
      Returns:
          np.ndarray: Spectrogram. Shape :math:`[C, T_spec]`. :math:`T_spec == T_wav / hop_length`
      """
      D = stft(y=wav, **kwargs)
      S = np.abs(D)
      return S.astype(np.float32)
  
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 11 for calling a global function with example usage: wav_to_spec() and returns: S