+
    œ°³j8&  ã                   ó~   € R t ^ RIt^RIHt ^RIHt ^RIHtH	t	H
t
 ]
P                  ! ]4      t ! R R]4      tR.tR# )z$Feature extractor class for EnCodec.N)ÚSequenceFeatureExtractor)ÚBatchFeature)ÚPaddingStrategyÚ
TensorTypeÚloggingc                   óœ   a a€ ] tR t^t oRtRR.tRV3R lV 3R lllt]V3R lR l4       t]V3R lR	 l4       t	RV3R
 lR llt
RtVtV ;t# )ÚEncodecFeatureExtractora×  
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)`.
Úinput_valuesÚpadding_maskc                óT   <€ V ^8„  d   QhRS[ RS[ RS[RS[R,          RS[R,          /# )é   Úfeature_sizeÚsampling_rateÚpadding_valueÚchunk_length_sNÚoverlap)ÚintÚfloat)ÚformatÚ__classdict__s   "€Úw/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/encodec/feature_extraction_encodec.pyÚ__annotate__Ú$EncodecFeatureExtractor.__annotate__4   sE   ø€ ÷ ñ áðñ ðñ ð	ñ
  �ðñ ˜•ñó    c           	     óL   <€ \         SV `  ! RR VRVRV/VB  W@n        WPn        R# )r   r   r   N© )ÚsuperÚ__init__r   r   )Úselfr   r   r   r   r   ÚkwargsÚ	__class__s   &&&&&&,€r   r   Ú EncodecFeatureExtractor.__init__4   s1   ø€ ô 	‰ÒÑw lÐwÀ-ÐwÐ_lÐwÐpvÒwØ,ÔØŽr   c                ó.   <€ V ^8„  d   QhRS[ R,          /# ©r   ÚreturnN©r   )r   r   s   "€r   r   r   C   s   ø€ ÷ Añ A™c D�jñ Ar   c                ón   € V P                   f   R # \        V P                   V P                  ,          4      # )N)r   r   r   ©r   s   &r   Úchunk_lengthÚ$EncodecFeatureExtractor.chunk_lengthB   s-   € à×ÑÒ&Ùä�t×*Ñ*¨T×-?Ñ-?Õ?Ó@Ð@r   c                ó.   <€ V ^8„  d   QhRS[ R,          /# r#   r%   )r   r   s   "€r   r   r   K   s   ø€ ÷ Iñ I™c D�jñ Ir   c                ó¬   € V P                   e   V P                  f   R # \        ^\        RV P                  ,
          V P                  ,          4      4      # )Ng      ð?)r   r   Úmaxr   r(   r'   s   &r   Úchunk_strideÚ$EncodecFeatureExtractor.chunk_strideJ   s@   € à×ÑÒ&¨$¯,©,Ò*>Ùä�qœ#˜s T§\¡\Õ1°T×5FÑ5FÕFÓGÓHÐHr   c                óR  <€ V ^8„  d   QhRS[ P                  S[S[,          ,          S[S[ P                  ,          ,          S[S[S[,          ,          ,          RS[S[,          S[,          R,          RS[R,          RS[R,          RS[S[,          R,          RS[R,          RS[	/# )	r   Ú	raw_audioÚpaddingNÚ
truncationÚ
max_lengthÚreturn_tensorsr   r$   )
ÚnpÚndarrayÚlistr   ÚboolÚstrr   r   r   r   )r   r   s   "€r   r   r   Q   s§   ø€ ÷ yñ yá—:‘:¡¡U¥Õ+©d±2·:±:Õ.>Õ>ÁÁdÉ5ÅkÕARÕRðyñ ™•™oÕ-°Õ4ðyñ ˜4•Kð	yñ
 ˜$•Jðyñ ™jÕ(¨4Õ/ðyñ ˜T•zðyñ 
ñyr   c                óB	  € Ve>   W`P                   8w  d-   \        RV  RV P                    RV P                    RV R2	4      hM-\        P                  RV P                  P
                   R24       V'       d   V'       d   \        R	4      hVf   R
p\        \        V\        \        34      ;'       d-    \        V^ ,          \        P                  \        \        34      4      pV'       dA   V Uu. uF3  p\        P                  ! V\        P                  R7      P                  NK5  	  ppMÀV'       gH   \        V\        P                  4      '       g(   \        P                  ! V\        P                  R7      pMq\        V\        P                  4      '       dR   VP                  \        P                  ! \        P                   4      J d    VP#                  \        P                  4      pV'       g"   \        P                  ! V4      P                  .p\%        V4       F»  w  ršV
P&                  ^8”  d   \        RV
P(                   24      hV P*                  ^8X  d2   V
P&                  ^8w  d!   \        RV
P(                  R,           R24      hV P*                  ^8X  g   Kƒ  V
P(                  R,          ^8w  g   K�  \        RV
P(                  R,           R24      h	  Rp\-        RV/4      pV P.                  Ee   V P0                  eó   Vfï   V'       dn   \3        R V 4       4      p\5        \        P6                  ! W@P.                  ,          4      4      pV^,
          V P.                  ,          V P0                  ,           pMyV'       dp   \9        R V 4       4      p\5        \        P:                  ! W@P.                  ,          4      4      pV^,
          V P.                  ,          V P0                  ,           pRpMTpVf3   V P=                  VVVVVR7      pV'       d   VP?                  R4      VR&   . pVP?                  R4       F8  p
V P*                  ^8X  d
   V
R,          p
VPA                  V
P                  4       K:  	  WËR&   Ve   VPC                  V4      pV# u upi )aª  
Main method to featurize and prepare for the model one or several sequence(s).

Args:
    raw_audio (`np.ndarray`, `list[float]`, `list[np.ndarray]`, `list[list[float]]`):
        The sequence or batch of sequences to be processed. Each sequence can be a numpy array, a list of float
        values, a list of numpy arrays or a list of list of float values. The numpy array must be of shape
        `(num_samples,)` for mono audio (`feature_size = 1`), or `(2, num_samples)` for stereo audio
        (`feature_size = 2`).
    padding (`bool`, `str` or [`~utils.PaddingStrategy`], *optional*, defaults to `True`):
        Select a strategy to pad the returned sequences (according to the model's padding side and padding
        index) among:

        - `True` or `'longest'`: Pad to the longest sequence in the batch (or no padding if only a single
          sequence if provided).
        - `'max_length'`: Pad to a maximum length specified with the argument `max_length` or to the maximum
          acceptable input length for the model if that argument is not provided.
        - `False` or `'do_not_pad'` (default): No padding (i.e., can output a batch with sequences of different
          lengths).
    truncation (`bool`, *optional*, defaults to `False`):
        Activates truncation to cut input sequences longer than `max_length` to `max_length`.
    max_length (`int`, *optional*):
        Maximum length of the returned list and optionally padding length (see above).
    return_tensors (`str` or [`~utils.TensorType`], *optional*):
        If set, will return tensors instead of list of python integers. Acceptable values are:

        - `'pt'`: Return PyTorch `torch.Tensor` objects.
        - `'np'`: Return Numpy `np.ndarray` objects.
    sampling_rate (`int`, *optional*):
        The sampling rate at which the `audio` input was sampled. It is strongly recommended to pass
        `sampling_rate` at the forward call to prevent silent errors.
Nz3The model corresponding to this feature extractor: z& was trained using a sampling rate of zB. Please make sure that the provided audio input was sampled with z	 and not Ú.zDIt is strongly recommended to pass the `sampling_rate` argument to `zN()`. Failing to do so can result in silent errors that might be hard to debug.zABoth padding and truncation were set. Make sure you only set one.T)Údtypez6Expected input shape (channels, length) but got shape z$Expected mono audio but example has z	 channelsz&Expected stereo audio but example has r	   c              3   óF   "  € T F  qP                   ^ ,          x € K  	  R# 5i©é    N©Úshape©Ú.0Úarrays   & r   Ú	<genexpr>Ú3EncodecFeatureExtractor.__call__.<locals>.<genexpr>©   ó   é € Ð G¹Y°E§¡¨Q§¢»Yùó   ‚!c              3   óF   "  € T F  qP                   ^ ,          x € K  	  R# 5ir>   r@   rB   s   & r   rE   rF   ­   rG   rH   r3   )r3   r2   r1   Úreturn_attention_maskÚattention_maskr
   éÿÿÿÿ).N)"r   Ú
ValueErrorÚloggerÚwarningr    Ú__name__r8   Ú
isinstancer7   Útupler5   r6   ÚasarrayÚfloat32ÚTr<   Úfloat64ÚastypeÚ	enumerateÚndimrA   r   r   r-   r(   Úminr   Úfloorr,   ÚceilÚpadÚpopÚappendÚconvert_to_tensors)r   r0   r1   r2   r3   r4   r   Ú
is_batchedÚaudioÚidxÚexampleÚpadded_inputsr	   Únb_steps   &&&&&&&       r   Ú__call__Ú EncodecFeatureExtractor.__call__Q   sÚ  € ðR Ò$Ø× 2Ñ 2Ô2Ü ØIÈ$Èð PØ×*Ñ*Ð+ð ,Ø×*Ñ*Ð+¨9°]°OÀ1ðFóð ð 3ô �N‰NØVÐW[×WeÑWe×WnÑWnÐVoð p\ð \ô÷
 —zÜÐ`ÓaÐaØŠ_àˆGäÜ�y¤4¬ -Ó0×jÐj´jÀÈ1ÅÔPR×PZÑPZÔ\aÔcgÐOhÓ6ió
ˆ
÷ ÙLUÓVÉIÀ5œŸš E´·±Ô<×>Ô>ÉIˆIÐVˆIß¤J¨y¼"¿*¹*×$EÒ$EÜŸ
š
 9´B·J±JÔ?‰IÜ˜	¤2§:¡:×.Ò.°9·?±?ÄbÇhÂhÌrÏzÉzÓFZÓ3ZØ!×(Ñ(¬¯©Ó4ˆI÷ ÜŸš IÓ.×0Ñ0Ð1ˆIô & iÖ0‰LˆCØ�|‰|˜aÔÜ Ð#YÐZa×ZgÑZgÐYhÐ!iÓjÐjØ× Ñ  AÔ%¨'¯,©,¸!Ô*;Ü Ð#GÈÏÉÐVXÕHYÐGZÐZcÐ!dÓeÐeØ× Ñ  AÖ%¨'¯-©-¸Õ*;¸qÖ*@Ü Ð#IÈ'Ï-É-ÐXZÕJ[ÐI\Ð\eÐ!fÓgÐgñ 1ð ˆÜ# ^°YÐ$?Ó@ˆØ×ÑÓ(¨T×->Ñ->Ò-JÈzÒOaßÜ Ñ G¹YÓ GÓG�
ÜœbŸhšh z×4EÑ4EÕ'EÓFÓG�Ø%¨�k¨T×->Ñ->Õ>À×ARÑARÕR‘
ßÜ Ñ G¹YÓ GÓG�
ÜœbŸgšg j×3DÑ3DÕ&DÓEÓF�Ø%¨�k¨T×->Ñ->Õ>À×ARÑARÕR�
Ø&‘à ,�ð Ò Ø ŸH™HØØ%Ø%ØØ&-ð %ó ˆM÷ Ø0=×0AÑ0AÐBRÓ0S�˜nÑ-àˆØ$×(Ñ(¨Ö8ˆGØ× Ñ  AÔ%Ø! )Õ,�Ø×Ñ §	¡	Ö*ñ 9ð
 )5�nÑ%ØÒ%Ø)×<Ñ<¸^ÓLˆMàÐùòq Ws   Ã/9R)r   r   )é   iÀ]  g        NN)NFNNN)rP   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Úmodel_input_namesr   Úpropertyr(   r-   rg   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r    r   s   @@r   r   r      s_   ù‡ € ñð. (¨Ð8Ð÷õ ð ÷Aó ðAð ÷Ió ðI÷y÷ yò yr   r   )rm   Únumpyr5   Ú!feature_extraction_sequence_utilsr   Úfeature_extraction_utilsr   Úutilsr   r   r   Ú
get_loggerrP   rN   r   Ú__all__r   r   r   Ú<module>ry      sE   ðñ +ã å IÝ 4ß 9Ñ 9ð 
×	Ò	˜HÓ	%€ôpÐ6ô pðf %Ð
%‚r   