code: def test_spectrogram_shapes(self):
      waveform = self._load_datasamples(1)[0]
  
      spec = spectrogram(
          waveform,
          window_function(400, "hann"),
          frame_length=400,
          hop_length=128,
          power=1.0,
          center=True,
          pad_mode="reflect",
          onesided=True,
      )
      self.assertEqual(spec.shape, (201, 732))
  
      spec = spectrogram(
          waveform,
          window_function(400, "hann"),
          frame_length=400,
          hop_length=128,
          power=1.0,
          center=False,
          pad_mode="reflect",
          onesided=True,
      )
      self.assertEqual(spec.shape, (201, 729))
  
      spec = spectrogram(
          waveform,
          window_function(400, "hann"),
          frame_length=400,
          hop_length=128,
          fft_length=512,
          power=1.0,
          center=True,
          pad_mode="reflect",
          onesided=True,
      )
      self.assertEqual(spec.shape, (257, 732))
  
      spec = spectrogram(
          waveform,
          window_function(400, "hann", frame_length=512),
          frame_length=512,
          hop_length=64,
          power=1.0,
          center=True,
          pad_mode="reflect",
          onesided=False,
      )
      self.assertEqual(spec.shape, (512, 1464))
  
      spec = spectrogram(
          waveform,
          window_function(512, "hann"),
          frame_length=512,
          hop_length=64,
          power=1.0,
          center=True,
          pad_mode="reflect",
          onesided=False,
      )
      self.assertEqual(spec.shape, (512, 1464))
  
      spec = spectrogram(
          waveform,
          window_function(512, "hann"),
          frame_length=512,
          hop_length=512,
          power=1.0,
          center=True,
          pad_mode="reflect",
          onesided=False,
      )
      self.assertEqual(spec.shape, (512, 183))
  
imports: import unittest
  import numpy
  import pytest
  from transformers.audio_utils import amplitude_to_db, hertz_to_mel, mel_filter_bank, mel_to_hertz, power_to_db, spectrogram, window_function
label_desc: Use image node_id 13 for calling the AudioUtilsFunctionTester obj's underlying member method code with example usage: obj.test_spectrogram_shapes() without return types