class_docstr: Constructs an EnCodec 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.
  
  Instantiating a feature extractor with the defaults will yield a similar configuration to that of the
  [facebook/encodec_24khz](https://huggingface.co/facebook/encodec_24khz) architecture.
  
  Args:
      feature_size (`int`, *optional*, defaults to 1):
          The feature dimension of the extracted features. Use 1 for mono, 2 for stereo.
      sampling_rate (`int`, *optional*, defaults to 24000):
          The sampling rate at which the audio waveform should be digitalized expressed in hertz (Hz).
      padding_value (`float`, *optional*, defaults to 0.0):
          The value that is used to fill the padding values.
      chunk_length_s (`float`, *optional*):
          If defined the audio is pre-processed into chunks of lengths `chunk_length_s` and then encoded.
      overlap (`float`, *optional*):
          Defines the overlap between each chunk. It is used to compute the `chunk_stride` using the following
          formulae : `int((1.0 - self.overlap) * self.chunk_length)`.
class_docstr_tok: ["Constructs","an","EnCodec","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",".","Instantiating","a","feature","extractor","with","the","defaults","will","yield","a","similar","configuration","to","that","of","the","[","facebook\/encodec_24khz","]","(","https",":","\/\/huggingface.co\/facebook\/encodec_24khz",")","architecture",".","Args",":","feature_size","(","`","int","`",",","*","optional","*",",","defaults","to","1",")",":","The","feature","dimension","of","the","extracted","features",".","Use","1","for","mono",",","2","for","stereo",".","sampling_rate","(","`","int","`",",","*","optional","*",",","defaults","to","24000",")",":","The","sampling","rate","at","which","the","audio","waveform","should","be","digitalized","expressed","in","hertz","(","Hz",")",".","padding_value","(","`","float","`",",","*","optional","*",",","defaults","to","0.0",")",":","The","value","that","is","used","to","fill","the","padding","values",".","chunk_length_s","(","`","float","`",",","*","optional","*",")",":","If","defined","the","audio","is","pre-processed","into","chunks","of","lengths","`","chunk_length_s","`","and","then","encoded",".","overlap","(","`","float","`",",","*","optional","*",")",":","Defines","the","overlap","between","each","chunk",".","It","is","used","to","compute","the","`","chunk_stride","`","using","the","following","formulae",":","`","int","(","(","1.0","-","self.overlap",")","*","self.chunk_length",")","`","."]
code: def chunk_length(self) -> Optional[int]:
      if self.chunk_length_s is None:
          return None
      else:
          return int(self.chunk_length_s * self.sampling_rate)
  
file_path: transformers/src/transformers/models/encodec/feature_extraction_encodec.py
imports: from typing import List, Optional, Union
  import numpy
  from ...feature_extraction_sequence_utils import SequenceFeatureExtractor
  from ...feature_extraction_utils import BatchFeature
  from ...utils import PaddingStrategy, TensorType, logging
label_desc: Use image node_id 2 for calling the EncodecFeatureExtractor obj's underlying member method code with example usage: obj.chunk_length() and returns: None, int