+
    œ°³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 ^RIHtHtHt ]! 4       '       d   ^ RIt^ RIHu Ht ]! 4       '       d   ^ RI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Úlogging)Úis_torch_availableÚis_torchaudio_availableÚrequires)Úbackendsc                   ój   a a€ ] tR t^$t oRt. ROtR	V 3R lltR
V3R lR lltV3R lR ltRt	Vt
V ;t# )ÚXcodec2FeatureExtractora¼  
Constructs a Xcodec2 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   &&&&&,€Úw/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/xcodec2/feature_extraction_xcodec2.pyr   Ú Xcodec2FeatureExtractor.__init__;   sz   ø€ ô 	‰ÒÑw lÐwÀ-ÐwÐ_lÐwÐpvÒwð %ŒÜ'?ØØ'Øô(
ˆÔ$ð
 ;BÀ>Ð9Rˆ×$Ñ$Ô6ð ˆŒØˆÔØˆÔØˆÖó    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__Ú$Xcodec2FeatureExtractor.__annotate__U   s€   ø€ ÷ K
ñ K
áðK
ñ ™•™oÕ-ðK
ñ ˜$•Jð	K
ñ
 ðK
ñ ™jÕ(¨4Õ/ðK
ñ ˜T•zðK
ñ ðK
ñ 
ñK
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F  pVe/   \'        VV,          P)                  4       P+                  4       4      MVP                  R",          pVV P                   ,           ^,
          V P                   ,          V P                   ,          p\-        VVP                  R",          4      pVVRRV13,          p\        P                  ! VV P                   ^,          V P                   ^,          3R
R7      pVP/                  V4      p\0        P2                  P4                  P7                  VR#,          V P8                  V P:                  V P                   ,          R,          V P<                  V P                   ,          R,          V P                   RRRRRR
R^V P                   ^,          R7      pVVP?                  ^ 4      ,
          \        P@                  ! VPC                  ^ RR7      R,           4      ,          pVPE                  V4       EK  	  \        RV/4      pV P                  VVVVV PF                  VRR7      pVR,          pVPI                  R4      pVP                  ^,          VP                  ^,          V PF                  ,          ,
          pVRRV1R3,          PK                  V
VV PF                  ,          V P8                  V PF                  ,          4      pVeT   VRRV13,          PK                  V
VV PF                  ,          V PF                  4      P-                  R"R7      PL                  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ºNNNiè  Ú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Úranger2   ÚsumÚitemÚminÚtoÚ
torchaudioÚ
complianceÚkaldiÚfbankr   r    r!   ÚmeanÚsqrtÚvarÚappendr   ÚgetÚreshapeÚvalues)r"   r   r*   r+   r,   r-   r   r.   r#   ÚexampleÚ
batch_sizeÚaÚpadded_inputsr   Úpadded_audioÚmel_featuresÚiÚorig_lenÚper_sample_lenÚ	valid_lenÚwaveformÚfeaturesÚencoded_inputsÚ
padded_melÚaudio_spectrogramÚspectrogram_maskÚtrimmed_framess   &&&&&&&&,                  r%   Ú__call__Ú Xcodec2FeatureExtractor.__call__U   s^  € ðZ Ò$Ø× 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Ø<HÒ<T”s˜<¨�?×.Ñ.Ó0×5Ñ5Ó7Ô8ÐZf×ZlÑZlÐmoÕZpˆHØ'¨$¯/©/Õ9¸AÕ=À$Ç/Á/ÕQÐUY×UdÑUdÕdˆNÜ˜N¨L×,>Ñ,>¸rÕ,BÓCˆIØ# A q¨*¨9¨*Ð$4Õ5ˆHÜ—u’u˜X¨¯©¸1Õ(<¸d¿o¹oÐQRÕ>RÐ'SÐ[^Ô_ˆHØ—{‘{ 6Ó*ˆ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ð	ð 'ô
ð 	
ùòE Ns   Â;6Rc                ó6   <€ V ^8„  d   QhRS[ S[S[3,          /# )r)   r/   )Údictr1   r   )r3   r4   s   "€r%   r5   r6   â   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$   rU   r]   )r"   Úoutputs   & r%   Úto_dictÚXcodec2FeatureExtractor.to_dictâ   s=   € Ü—’˜tŸ}™}Ó-ˆØ+/¯>©>×+BÑ+BˆÐ'Ñ(Ø�
‰
Ð,¨dÔ3Øˆr'   )r   r    r!   r   r   r   )rK   rM   r   rN   )éP   i€>  g      ð?i@  )TNFNNÚcpu)rU   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r   r‰   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r$   r4   s   @@r%   r   r   $   s4   ù‡ € ñò& bÐ÷÷4K
ò K
÷Z÷ ð r'   r   )rc   )r…   Útypingr   Úaudio_utilsr   r   Ú!feature_extraction_sequence_utilsr   Úfeature_extraction_utilsr   Úutilsr   r	   r
   Úutils.import_utilsr   r   r   r[   Útorch.nn.functionalÚnnÚ
functionalrY   rc   Ú
get_loggerrU   rS   r   Ú__all__r   r'   r%   Ú<module>rŸ      sƒ   ðó Ý ç 9Ý IÝ 4ß 9Ñ 9ß WÑ Wñ ×ÒÛß#Ð#á×ÒÛð 
×	Ò	˜HÓ	%€ñ 
�?Ô#ôAÐ6ó Aó $ðAðH %Ð
%‚r'   