code: def create_spec(filename, hparams):
      """Processes an audio file into a spectrogram."""
      wav_data = tf.gfile.Open(filename, "rb").read()
      spec = data.wav_to_spec(wav_data, hparams)
      return spec
  
file_path: magenta/magenta/models/onsets_frames_transcription/onsets_frames_transcription_spectrogram_json.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import json
  from magenta.models.onsets_frames_transcription import configs
  from magenta.models.onsets_frames_transcription import data
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling a global function with example usage: create_spec(filename, hparams) and returns: spec