code: def _wav_to_framed_samples(wav_audio, hparams):
      """Transforms the contents of a wav file into a series of framed samples."""
      y = audio_io.wav_data_to_samples(wav_audio, hparams.sample_rate)
  
      hl = hparams.spec_hop_length
      n_frames = int(np.ceil(y.shape[0] / hl))
      frames = np.zeros((n_frames, hl), dtype=np.float32)
  
      # Fill in everything but the last frame which may not be the full length
      cutoff = (n_frames - 1) * hl
      frames[: n_frames - 1, :] = np.reshape(
          y[:cutoff], (n_frames - 1, hl)
      )
      # Fill the last frame
      remain_len = len(y[cutoff:])
      frames[n_frames - 1, :remain_len] = y[cutoff:]
  
      return frames
  
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 5 for calling a global function with example usage: _wav_to_framed_samples(wav_audio, hparams) and returns: frames