class_docstr: Constructs a CLVP feature extractor.
  
  This feature extractor inherits from [`~feature_extraction_sequence_utils.SequenceFeatureExtractor`] which contains
  most of the main methods. Users should refer to this superclass for more information regarding those methods.
  
  This class extracts log-mel-spectrogram 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`, *optional*, defaults to 80):
          The feature dimension of the extracted features.
      sampling_rate (`int`, *optional*, defaults to 22050):
          The sampling rate at which the audio files should be digitalized expressed in hertz (Hz).
      default_audio_length (`int`, *optional*, defaults to 6):
          The default length of raw audio in seconds. If `max_length` is not set during `__call__` then it will
          automatically be set to default_audio_length * `self.sampling_rate`.
      hop_length (`int`, *optional*, defaults to 256):
          Length of the overlaping windows for the STFT used to obtain the Mel Frequency coefficients.
      chunk_length (`int`, *optional*, 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`, *optional*, defaults to 1024):
          Size of the Fourier transform.
      padding_value (`float`, *optional*, defaults to 0.0):
          Padding value used to pad the audio. Should correspond to silences.
      mel_norms (`list` of length `feature_size`, *optional*):
          If `mel_norms` is provided then it will be used to normalize the log-mel spectrograms along each
          mel-filter.
      return_attention_mask (`bool`, *optional*, defaults to `False`):
          Whether to return the attention mask. If left to the default, it will return the attention mask.
  
          [What are attention masks?](../glossary#attention-mask)
class_docstr_tok: ["Constructs","a","CLVP","feature","extractor",".","This","feature","extractor","inherits","from","[","`","~feature_extraction_sequence_utils.SequenceFeatureExtractor","`","]","which","contains","most","of","the","main","methods",".","Users","should","refer","to","this","superclass","for","more","information","regarding","those","methods",".","This","class","extracts","log-mel-spectrogram","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","`",",","*","optional","*",",","defaults","to","80",")",":","The","feature","dimension","of","the","extracted","features",".","sampling_rate","(","`","int","`",",","*","optional","*",",","defaults","to","22050",")",":","The","sampling","rate","at","which","the","audio","files","should","be","digitalized","expressed","in","hertz","(","Hz",")",".","default_audio_length","(","`","int","`",",","*","optional","*",",","defaults","to","6",")",":","The","default","length","of","raw","audio","in","seconds",".","If","`","max_length","`","is","not","set","during","`","__call__","`","then","it","will","automatically","be","set","to","default_audio_length","*","`","self.sampling_rate","`",".","hop_length","(","`","int","`",",","*","optional","*",",","defaults","to","256",")",":","Length","of","the","overlaping","windows","for","the","STFT","used","to","obtain","the","Mel","Frequency","coefficients",".","chunk_length","(","`","int","`",",","*","optional","*",",","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","`",",","*","optional","*",",","defaults","to","1024",")",":","Size","of","the","Fourier","transform",".","padding_value","(","`","float","`",",","*","optional","*",",","defaults","to","0.0",")",":","Padding","value","used","to","pad","the","audio",".","Should","correspond","to","silences",".","mel_norms","(","`","list","`","of","length","`","feature_size","`",",","*","optional","*",")",":","If","`","mel_norms","`","is","provided","then","it","will","be","used","to","normalize","the","log-mel","spectrograms","along","each","mel-filter",".","return_attention_mask","(","`","bool","`",",","*","optional","*",",","defaults","to","`","False","`",")",":","Whether","to","return","the","attention","mask",".","If","left","to","the","default",",","it","will","return","the","attention","mask",".","[","What","are","attention","masks","?","]","(","..","\/glossary","#","attention-mask",")"]
code: def __init__(
      self,
      feature_size=80,
      sampling_rate=22050,
      default_audio_length=6,
      hop_length=256,
      chunk_length=30,
      n_fft=1024,
      padding_value=0.0,
      mel_norms=None,
      return_attention_mask=False,  # pad inputs to max length with silence token (zero) and no attention mask
      **kwargs,
  ):
      super().__init__(
          feature_size=feature_size,
          sampling_rate=sampling_rate,
          padding_value=padding_value,
          return_attention_mask=return_attention_mask,
          **kwargs,
      )
      self.n_fft = n_fft
      self.hop_length = hop_length
      self.chunk_length = chunk_length
      self.n_samples = chunk_length * sampling_rate
      self.nb_max_frames = self.n_samples // hop_length
      self.sampling_rate = sampling_rate
      self.default_audio_length = default_audio_length
      self.mel_norms = mel_norms
      self.mel_filters = mel_filter_bank(
          num_frequency_bins=1 + (n_fft // 2),
          num_mel_filters=feature_size,
          min_frequency=0.0,
          max_frequency=8000.0,
          sampling_rate=sampling_rate,
          norm="slaney",
          mel_scale="htk",
      )
  
file_path: transformers/src/transformers/models/clvp/feature_extraction_clvp.py
imports: from typing import List, Optional, Union
  import numpy
  from ...audio_utils import mel_filter_bank, spectrogram, window_function
  from ...feature_extraction_sequence_utils import SequenceFeatureExtractor
  from ...feature_extraction_utils import BatchFeature
  from ...utils import TensorType, logging
label_desc: Use image node_id 1 to create a new ClvpFeatureExtractor object from inherited base classes: SequenceFeatureExtractor with example: obj = ClvpFeatureExtractor(feature_size, sampling_rate, default_audio_length, hop_length, chunk_length, n_fft, padding_value, mel_norms, return_attention_mask)