code: def _wav_to_mel(wav_audio, hparams):
      """Transforms the contents of a wav file into a series of mel spec frames."""
      y = audio_io.wav_data_to_samples(wav_audio, hparams.sample_rate)
  
      mel = librosa.feature.melspectrogram(
          y,
          hparams.sample_rate,
          hop_length=hparams.spec_hop_length,
          fmin=hparams.spec_fmin,
          n_mels=hparams.spec_n_bins,
          htk=hparams.spec_mel_htk,
      ).astype(np.float32)
  
      # Transpose so that the data is in [frame, bins] format.
      mel = mel.T
      return mel
  
imports: import collections
  import functools
  import io
  import re
  import wave
  import zlib
  import librosa
  from magenta.models.onsets_frames_transcription import audio_transform
  from magenta.models.onsets_frames_transcription import constants
  from magenta.models.onsets_frames_transcription import drum_mappings
  from magenta.models.onsets_frames_transcription import melspec_input
  from note_seq import audio_io
  from note_seq import sequences_lib
  from note_seq.protobuf import music_pb2
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 4 for calling a global function with example usage: _wav_to_mel(wav_audio, hparams) and returns: mel