class_docstr: Constructs a Whisper feature extractor.
  
  This feature extractor inherits from [`WhisperFeatureExtractor`] which contains most of the main methods. Users
  should refer to this superclass for more information regarding those methods.
  
  This class extracts mel-filter bank features from raw speech using a custom numpy implementation of the `Short Time
  Fourier Transform` which should match pytorch's `torch.stft` equivalent.
  
  Args:
      feature_size (`int`, defaults to 80):
          The feature dimension of the extracted features.
      sampling_rate (`int`, defaults to 16000):
          The sampling rate at which the audio files should be digitalized expressed in Hertz per second (Hz).
      hop_length (`int`, defaults to 160):
          Length of the overlaping windows for the STFT used to obtain the Mel Frequency coefficients.
      chunk_length (`int`, defaults to 30):
          The maximum number of chuncks of `sampling_rate` samples used to trim and pad longer or shorter audio
          sequences.
      n_fft (`int`, defaults to 400):
          Size of the Fourier transform.
      padding_value (`float`, *optional*, defaults to 0.0):
          Padding value used to pad the audio. Should correspond to silences.
docstr: Transform a raw waveform into a list of smaller waveforms. The window length defines how much of the signal is
  contain in each frame (smalle waveform), while the hope length defines the step between the beginning of each
  new frame.
  
  Centering is done by reflecting the waveform which is first centered around `frame_idx * hop_length`.
docstr_tok: ["Transform","a","raw","waveform","into","a","list","of","smaller","waveforms",".","The","window","length","defines","how","much","of","the","signal","is","contain","in","each","frame","(","smalle","waveform",")",",","while","the","hope","length","defines","the","step","between","the","beginning","of","each","new","frame",".","Centering","is","done","by","reflecting","the","waveform","which","is","first","centered","around","`","frame_idx","*","hop_length","`","."]
code: def fram_wave(self, waveform, center=True):
      """
      Transform a raw waveform into a list of smaller waveforms. The window length defines how much of the signal is
      contain in each frame (smalle waveform), while the hope length defines the step between the beginning of each
      new frame.
  
      Centering is done by reflecting the waveform which is first centered around `frame_idx * hop_length`.
      """
      frames = []
      for i in range(0, waveform.shape[0] + 1, self.hop_length):
          half_window = (self.n_fft - 1) // 2 + 1
          if center:
              start = i - half_window if i > half_window else 0
              end = (
                  i + half_window
                  if i < waveform.shape[0] - half_window
                  else waveform.shape[0]
              )
  
              frame = waveform[start:end]
  
              if start == 0:
                  padd_width = (-i + half_window, 0)
                  frame = np.pad(
                      frame, pad_width=padd_width, mode="reflect"
                  )
  
              elif end == waveform.shape[0]:
                  padd_width = (
                      0,
                      (i - waveform.shape[0] + half_window),
                  )
                  frame = np.pad(
                      frame, pad_width=padd_width, mode="reflect"
                  )
  
          else:
              frame = waveform[i : i + self.n_fft]
              frame_width = frame.shape[0]
              if frame_width < waveform.shape[0]:
                  frame = np.lib.pad(
                      frame,
                      pad_width=(0, self.n_fft - frame_width),
                      mode="constant",
                      constant_values=0,
                  )
  
          frames.append(frame)
      return np.stack(frames, 0)
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/models/whisper/feature_extraction_whisper.py
imports: from typing import List, Optional, Union
  import numpy
  from numpy.fft import fft
  from ...feature_extraction_sequence_utils import SequenceFeatureExtractor
  from ...feature_extraction_utils import BatchFeature
  from ...utils import TensorType, logging
label_desc: Use image node_id 3 for calling the WhisperFeatureExtractor obj's underlying member method code with example usage: obj.fram_wave(waveform, center) and returns: np