code: def wav_to_spec_op(wav_audio, hparams):
      """Return an op for converting wav audio to a spectrogram."""
      if hparams.spec_type == "tflite_compat_mel":
          assert hparams.spec_log_amplitude
          spec = tflite_compat_mel(wav_audio, hparams=hparams)
      else:
          spec = tf.py_func(
              functools.partial(wav_to_spec, hparams=hparams),
              [wav_audio],
              tf.float32,
              name="wav_to_spec",
          )
          spec.set_shape([None, hparams_frame_size(hparams)])
      return spec
  
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 7 for calling a global function with example usage: wav_to_spec_op(wav_audio, hparams) and returns: spec