+
    œ°³jÃ-  ã                   ó  € ^ RI t ^ RIHt ^RIHtHt ^RIHt ^RIH	t	 ^RI
HtHtHtHt ^RIHtHt ]! 4       '       d   ^ RIt]! 4       '       d   ^ RIt^ RIHu Ht ]P0                  ! ]4      t]! RR7       ! R	 R
]4      4       tR
.tR# )é    N)ÚAny)Ú
AudioInputÚmake_list_of_audio)ÚSequenceFeatureExtractor)ÚBatchFeature)ÚPaddingStrategyÚ
TensorTypeÚis_torch_availableÚlogging)Úis_torchaudio_availableÚrequires©Úbackendsc                   ó‚   a a€ ] tR t^)t oRt. R	OtR
V 3R llt]! RR7      RV3R lR ll4       tV3R lR lt	Rt
VtV ;t# )ÚNeuCodecFeatureExtractora½  
Constructs a NeuCodec feature extractor, which computes mel-filter bank features for the semantic encoder and padded
audio for the acoustic encoder.

This feature extractor inherits from [`SequenceFeatureExtractor`] which contains most of the main methods. Users
should refer to this superclass for more information regarding those methods.

Args:
    feature_size (`int`, *optional*, defaults to 80):
        The feature dimension of the extracted features.
    sampling_rate (`int`, *optional*, defaults to 16000):
        The sample rate at which the audio files should be digitalized expressed in hertz (Hz).
    padding_value (`float`, *optional*, defaults to 1.0):
        The value that is used to fill the padding vectors for the mel spectrogram.
    hop_length (`int`, *optional*, defaults to 320):
        Number of audio samples encoded per frame. Equivalent to product of downsampling ratios.
        Needed for acoustic encoder input padding.
c           	     óÄ   <€ \         SV `  ! R	R VRVRV/VB  W@n        \        ^VRR7      V n        RR.V P                  n        ^V n        ^PV n        RV n        ^ V n	        R# )
Úfeature_sizeÚsampling_rateÚpadding_valueç        )r   r   r   ÚaudioÚpadding_maski�  N© )
ÚsuperÚ__init__Ú
hop_lengthr   Úacoustic_encoder_padderÚmodel_input_namesÚstrideÚnum_mel_binsÚframe_lengthÚframe_shift)Úselfr   r   r   r   ÚkwargsÚ	__class__s   &&&&&,€Úy/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/neucodec/feature_extraction_neucodec.pyr   Ú!NeuCodecFeatureExtractor.__init__@   sz   ø€ ô 	‰ÒÑw lÐwÀ-ÐwÐ_lÐwÐpvÒwð %ŒÜ'?ØØ'Øô(
ˆÔ$ð
 ;BÀ>Ð9Rˆ×$Ñ$Ô6ð ˆŒØˆÔØˆÔØˆÖó    r   c                ó¤   <€ V ^8„  d   QhRS[ RS[S[,          S[,          RS[R,          RS[RS[S[,          R,          RS[R,          RS[R	S[/# )
é   r   ÚpaddingÚ
max_lengthNÚ
truncationÚreturn_tensorsr   ÚdeviceÚreturn)r   ÚboolÚstrr   Úintr	   r   )ÚformatÚ__classdict__s   "€r&   Ú__annotate__Ú%NeuCodecFeatureExtractor.__annotate__[   s€   ø€ ÷ N
ñ N
áðN
ñ ™•™oÕ-ðN
ñ ˜$•Jð	N
ñ
 ðN
ñ ™jÕ(¨4Õ/ðN
ñ ˜T•zðN
ñ ðN
ñ 
ñN
r(   c                óð  € 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4      pV F,  p	V	P                  ^8”  g   K  \        R	V	P                   24      h	  \        V4      p
V Uu. uF0  p\        P                  ! \        P                  ! V4      R!R
R7      NK2  	  ppV P                  P                  \        RV/4      VVVVV P                   RR7      pVP#                  R4      pVR,          R",          p. p\%        V
4       EFZ  pV P                  P                  \        RVV,          ./4      V P                   RR7      pVR,          P'                  V4      p\(        P*                  P,                  P/                  VR#,          V P0                  V P2                  V P                   ,          R,          V P4                  V P                   ,          R,          V P                   RRRRRR
R^V P                   ^,          R7      pVVP7                  ^ 4      ,
          \        P8                  ! VP;                  ^ RR7      R,           4      ,          pVP=                  V4       EK]  	  \        RV/4      pV P                  VVVVV P>                  VRR7      pVR,          pVPA                  R4      pVP                  ^,          VP                  ^,          V P>                  ,          ,
          pVRRV1R3,          PC                  V
VV P>                  ,          V P0                  V P>                  ,          4      pVeT   VRRV13,          PC                  V
VV P>                  ,          V P>                  4      PE                  R$R7      PF                  p\        RVRVRVRV/VR 7      # u upi )%aÌ  
Args:
    audio (`np.ndarray`, `torch.Tensor`, `list[np.ndarray]`, `list[torch.Tensor]`):
        Numpy array or torch tensor with shape (num_channels, sequence_length). A list of such arrays or
        tensors can also be provided for a batch of inputs.
    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).
    max_length (`int`, *optional*):
        Maximum length of the returned list and optionally padding length (see above).
    truncation (`bool`):
        Activates truncation to cut input sequences longer than *max_length* to *max_length*.
    return_tensors (`str` or [`~utils.TensorType`], *optional*):
        If set, will return tensors instead of list of python integers. Acceptable values are:

        - `'tf'`: Return TensorFlow `tf.constant` objects.
        - `'pt'`: Return PyTorch `torch.Tensor` objects.
        - `'np'`: Return Numpy `np.ndarray` objects.
    sampling_rate (`int`, *optional*):
        The sample rate at which the `audio` input was sampled. It is strongly recommended to pass
        `sampling_rate` at the forward call to prevent silent errors.
    device (`str`, *optional*, defaults to `"cpu"`):
        Device for PyTorch tensors during mel-filter bank feature extraction.
    kwargs (*optional*):
        Remaining dictionary of keyword arguments that will be passed to the tokenizer or the feature
        extractor.
Nz3The model corresponding to this feature extractor: z& was trained using a sampling rate of zD. 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.z6Expected input shape (channels, length) but got shape r   )Úvaluer   Úpt)r,   r-   r+   Úreturn_attention_maskÚpad_to_multiple_ofr.   Úattention_maskºNNN)r=   r.   iè  Úpoveyg
×£p=
ï?TF)r    r!   r"   Úsample_frequencyÚwindow_typeÚpreemphasis_coefficientÚremove_dc_offsetÚuse_log_fbankÚ
use_energyÚditherÚ
snip_edgesÚlow_freqÚ	high_freq)ÚunbiasedgH¯¼šò×z>Úinput_features)r+   r,   r-   r=   r<   r.   )ÚdimÚinput_valuesr   Úinput_features_mask)Útensor_type)r   é   )r?   Nr?   i €  éÿÿÿÿ)$r   Ú
ValueErrorÚloggerÚwarningr%   Ú__name__r   ÚndimÚshapeÚlenÚFÚpadÚtorchÚ	as_tensorr   r   r   ÚpopÚrangeÚtoÚ
torchaudioÚ
complianceÚkaldiÚfbankr    r!   r"   ÚmeanÚsqrtÚvarÚappendr   ÚgetÚreshapeÚminÚvalues)r#   r   r+   r,   r-   r.   r   r/   r$   ÚexampleÚ
batch_sizeÚaÚpadded_inputsr   Úpadded_audioÚmel_featuresÚiÚsingle_padded_audioÚwaveformÚfeaturesÚencoded_inputsÚ
padded_melÚaudio_spectrogramÚspectrogram_maskÚtrimmed_framess   &&&&&&&&,                r&   Ú__call__Ú!NeuCodecFeatureExtractor.__call__Z   sî  € ð^ Ò$Ø× 2Ñ 2Ô2Ü ØIÈ$Èð PØ×*Ñ*Ð+ð ,Ø×*Ñ*Ð+¨9°]°OÀ1ðFóð ð 3ô �N‰NØVÐW[×WeÑWe×WnÑWnÐVoð p\ð \ôô
 # 5Ó)ˆÛˆGØ�|‰|˜aÖÜ Ð#YÐZa×ZgÑZgÐYhÐ!iÓjÐjñ ô ˜“Zˆ
ñ HMÓMÁuÀ!”—’”u—’ qÓ)¨6¸×=ÁuˆÐMØ×4Ñ4×8Ñ8Ü˜' 5Ð)Ó*Ø!Ø!ØØ")Ø#Ÿ™Øð 9ó 
ˆð %×(Ñ(Ð)9Ó:ˆØ$ WÕ-¨jÕ9ˆð ˆÜ�z×"ˆAØ"&×">Ñ">×"BÑ"BÜ˜g¨¨a­ zÐ2Ó3Ø#'§?¡?Ø#ð #Có #Ðð
 +¨7Õ3×6Ñ6°vÓ>ˆHÜ!×,Ñ,×2Ñ2×8Ñ8Ø˜EÕ"Ø!×.Ñ.Ø!×.Ñ.°×1CÑ1CÕCÀdÕJØ ×,Ñ,¨t×/AÑ/AÕAÀDÕHØ!%×!3Ñ!3Ø#Ø(,Ø!%Ø"Ø ØØØØ×,Ñ,°Õ1ð 9ó ˆHð  ! 8§=¡=°Ó#3Õ3´u·z²zÀ(Ç,Á,ÈqÐ[_À,ÓB`ÐcgÕBgÓ7hÕhˆHØ×Ñ ×)ñ1 #ô2 &Ð'7¸Ð&FÓGˆØ—X‘XØØØ!Ø!Ø#Ÿ{™{Ø")Øð ó 
ˆ
ð 'Ð'7Õ8ÐØ%Ÿ>™>Ð*:Ó;ÐØ*×0Ñ0°Õ3Ð7H×7NÑ7NÈqÕ7QÐTX×T_ÑT_Õ7_Õ`ˆØ-¨a°°.°À!Ð.CÕD×LÑLØ˜¨$¯+©+Õ5°t×7HÑ7HÈ4Ï;É;Õ7Vó
Ðð Ò'à   O ^ OÐ!3Õ4ß‘˜ ^°t·{±{Õ%BÀDÇKÁKÓPß‘˜�“ß‘ð	 ô à Ø Ø Ð"3Ø%Ð'7ð	ð 'ô
ð 	
ùòI Ns   Â;6O3c                ó6   <€ V ^8„  d   QhRS[ S[S[3,          /# )r*   r0   )Údictr2   r   )r4   r5   s   "€r&   r6   r7   ë   s   ø€ ÷ ñ ™™c¡3˜h�ñ r(   c                óœ   € \         P                  ! V P                  4      pV P                  P                  VR &   VP                  RR4       V# )Úfeature_extractor_typer   N)ÚcopyÚdeepcopyÚ__dict__r%   rV   r^   )r#   Úoutputs   & r&   Úto_dictÚ NeuCodecFeatureExtractor.to_dictë   s=   € Ü—’˜tŸ}™}Ó-ˆØ+/¯>©>×+BÑ+BˆÐ'Ñ(Ø�
‰
Ð,¨dÔ3Øˆr(   )r   r!   r"   r   r    r   )rL   rN   r   rO   )éP   i€>  g      ð?i@  )r\   ra   )TNFNNÚcpu)rV   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r   r|   r†   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r%   r5   s   @@r&   r   r   )   sJ   ù‡ € ñò& bÐ÷ñ4 Ð.Ô/÷N
ñ N
ó 0ðN
÷`÷ ð r(   r   )ra   )r‚   Útypingr   Úaudio_utilsr   r   Ú!feature_extraction_sequence_utilsr   Úfeature_extraction_utilsr   Úutilsr   r	   r
   r   Úutils.import_utilsr   r   ra   r\   Útorch.nn.functionalÚnnÚ
functionalrZ   Ú
get_loggerrV   rT   r   Ú__all__r   r(   r&   Ú<module>rœ      s€   ðó* Ý ç 9Ý IÝ 4ß MÓ Mß Cñ ×ÒÛÙ×ÒÛß#Ð#ð 
×	Ò	˜HÓ	%€ñ 
�?Ô#ôEÐ7ó Eó $ðEðP &Ð
&‚r(   