code: def wav_to_mel_spectrogram(wav):
      """
      Derives a mel spectrogram ready to be used by the encoder from a preprocessed audio waveform.
      Note: this not a log-mel spectrogram.
      """
      frames = librosa.feature.melspectrogram(
          y=wav,
          sr=sampling_rate,
          n_fft=int(sampling_rate * mel_window_length / 1000),
          hop_length=int(sampling_rate * mel_window_step / 1000),
          n_mels=mel_n_channels,
      )
      return frames.astype(np.float32).T
  
file_path: TTS/TTS/vc/modules/freevc/speaker_encoder/audio.py
imports: import struct
  from pathlib import Path
  from typing import Optional, Union
  import librosa
  import numpy
  from scipy.ndimage.morphology import binary_dilation
  from TTS.vc.modules.freevc.speaker_encoder.hparams import *
label_desc: Use image node_id 2 for calling a global function with example usage: wav_to_mel_spectrogram(wav) and returns: frames