+
    œ°³jTA  ã                   ó¢   € R t ^ RIHt ^ RIt^RIHtHtHtH	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 SpeechT5.)ÚAnyN)Úmel_filter_bankÚoptimal_fft_lengthÚspectrogramÚwindow_function)Ú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]RV3R lR ll4       tV3R lR	 lt	RV3R
 lR llt
RV3R lR lltV3R lV 3R lltRtVtV ;t# )ÚSpeechT5FeatureExtractoraC  
Constructs a SpeechT5 feature extractor.

This class can pre-process a raw speech signal by (optionally) normalizing to zero-mean unit-variance, for use by
the SpeechT5 speech encoder prenet.

This class can also extract log-mel filter bank features from raw speech, for use by the SpeechT5 speech decoder
prenet.

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.

Args:
    feature_size (`int`, *optional*, defaults to 1):
        The feature dimension of the extracted features.
    sampling_rate (`int`, *optional*, defaults to 16000):
        The sampling rate at which the audio files 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.
    do_normalize (`bool`, *optional*, defaults to `False`):
        Whether or not to zero-mean unit-variance normalize the input. Normalizing can help to significantly
        improve the performance for some models.
    num_mel_bins (`int`, *optional*, defaults to 80):
        The number of mel-frequency bins in the extracted spectrogram features.
    hop_length (`int`, *optional*, defaults to 16):
        Number of ms between windows. Otherwise referred to as "shift" in many papers.
    win_length (`int`, *optional*, defaults to 64):
        Number of ms per window.
    win_function (`str`, *optional*, defaults to `"hann_window"`):
        Name for the window function used for windowing, must be accessible via `torch.{win_function}`
    fmin (`float`, *optional*, defaults to 80):
        Minimum mel frequency in Hz.
    fmax (`float`, *optional*, defaults to 7600):
        Maximum mel frequency in Hz.
    mel_floor (`float`, *optional*, defaults to 1e-10):
        Minimum value of mel frequency banks..
    return_attention_mask (`bool`, *optional*, defaults to `True`):
        Whether or not [`~SpeechT5FeatureExtractor.__call__`] should return `attention_mask`.
Úinput_valuesÚattention_maskc                ób   <€ V ^8„  d   QhRS[ RS[ RS[RS[RS[ RS[ RS[ RS[R	S[R
S[RS[RS[/# )é   Úfeature_sizeÚsampling_rateÚpadding_valueÚdo_normalizeÚnum_mel_binsÚ
hop_lengthÚ
win_lengthÚwin_functionÚfminÚfmaxÚ	mel_floorÚreturn_attention_mask)ÚintÚfloatÚboolÚstr)ÚformatÚ__classdict__s   "€Úy/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/speecht5/feature_extraction_speecht5.pyÚ__annotate__Ú%SpeechT5FeatureExtractor.__annotate__H   sƒ   ø€ ÷ +
ñ +
áð+
ñ ð+
ñ ð	+
ñ
 ð+
ñ ð+
ñ ð+
ñ ð+
ñ ð+
ñ ð+
ñ ð+
ñ ð+
ñ  $ñ+
ó    c           
     óB  <€ \         SV `  ! R	R VRVRV/VB  W@n        WÀn        WPn        W`n        Wpn        W€n        W�n        W n	        W°n
        Wr,          R,          V n        Wb,          R,          V n        \        V P                  4      V n        V P                  ^,          ^,           V n        \!        V P                  V P                  RR7      V n        \%        V P                  V P                  V P                  V P                  V P&                  RRR7      V n        R# )
r   r   r   iè  T)Úwindow_lengthÚnameÚperiodicÚslaney)Únum_frequency_binsÚnum_mel_filtersÚmin_frequencyÚmax_frequencyr   ÚnormÚ	mel_scaleN© )ÚsuperÚ__init__r   r   r   r   r   r   r   r   r   Úsample_sizeÚsample_strider   Ún_fftÚn_freqsr   Úwindowr   r   Úmel_filters)Úselfr   r   r   r   r   r   r   r   r   r   r   r   ÚkwargsÚ	__class__s   &&&&&&&&&&&&&,€r$   r5   Ú!SpeechT5FeatureExtractor.__init__H   sô   ø€ ô  	‰ÒÑw lÐwÀ-ÐwÐ_lÐwÐpvÒwØ(ÔØ%:Ô"à(ÔØ$ŒØ$ŒØ(ÔØŒ	ØŒ	Ø"Œà%Õ5¸Õ=ˆÔØ'Õ7¸4Õ?ˆÔÜ'¨×(8Ñ(8Ó9ˆŒ
ØŸ
™
 a�¨1Õ,ˆŒä%°D×4DÑ4DÈ4×K\ÑK\ÐgkÔlˆŒä*Ø#Ÿ|™|Ø ×-Ñ-ØŸ)™)ØŸ)™)Ø×,Ñ,ØØô
ˆÖr'   c          	      óž   <€ V ^8„  d   QhRS[ S[P                  ,          RS[ S[P                  ,          RS[RS[ S[P                  ,          /# )r   r   r   r   Úreturn)ÚlistÚnpÚndarrayr   )r"   r#   s   "€r$   r%   r&   w   sH   ø€ ÷ #ñ #Ù™2Ÿ:™:Õ&ð#Ù8<¹R¿Z¹ZÕ8Hð#ÙY^ð#á	‰b�j‰jÕ	ñ#r'   c                óJ  € VeÅ   \         P                  ! V\         P                  4      p. p\        WP	                  R4      4       F}  w  rEWDRV P                  4       ,
          \         P                  ! VRV P                  4       R,           4      ,          pWVP                  ^ ,          8  d   W&VR% VP                  V4       K  	  V# V  Uu. uFI  qwVP                  4       ,
          \         P                  ! VP                  4       R,           4      ,          NKK  	  ppV# u upi )zK
Every array in the list is normalized to have zero mean and unit variance
NgH¯¼šò×z>éÿÿÿÿ)
rC   ÚarrayÚint32ÚzipÚsumÚmeanÚsqrtÚvarÚshapeÚappend)r   r   r   Únormed_input_valuesÚvectorÚlengthÚnormed_sliceÚxs   &&&     r$   Úzero_mean_unit_var_normÚ0SpeechT5FeatureExtractor.zero_mean_unit_var_normu   sù   € ð Ò%ÜŸXšX n´b·h±hÓ?ˆNØ"$Ðä"% l×4FÑ4FÀrÓ4JÖ"K‘�Ø &°°¨×)=Ñ)=Ó)?Õ ?Ä2Ç7Â7È6ÐRYÐSYÈ?×K^ÑK^ÓK`ÐcgÕKgÓChÕh�Ø×.Ñ.¨qÕ1Ô1Ø,9  Ð)à#×*Ñ*¨<Ö8ñ #Lð #Ð"ñ VbÓ"bÑUaÐPQ¨¯©«¥L´B·G²G¸A¿E¹E»GÀd½NÓ4K×#KÐ#KÑUaÐÐ"bà"Ð"ùò #cs   ÃAD c                óN   <€ V ^8„  d   QhRS[ P                  RS[ P                  /# )r   Úone_waveformrA   )rC   rD   )r"   r#   s   "€r$   r%   r&   Œ   s'   ø€ ÷ ñ á—j‘jðñ 
�‰ñr'   c                ó¸   € \        VV P                  V P                  V P                  V P                  V P
                  V P                  RR7      pVP                  # )zJ
Extracts log-mel filterbank features for one waveform array (unbatched).
Úlog10)r:   Úframe_lengthr   Ú
fft_lengthr;   r   Úlog_mel)r   r:   r6   r7   r8   r;   r   ÚT)r<   rX   Úlog_mel_specs   && r$   Ú_extract_mel_featuresÚ.SpeechT5FeatureExtractor._extract_mel_featuresŒ   sP   € ô #ØØ—;‘;Ø×)Ñ)Ø×)Ñ)Ø—z‘zØ×(Ñ(Ø—n‘nØô	
ˆð �~‰~Ðr'   c                ó  <€ V ^8„  d   QhRS[ P                  S[S[,          ,          S[S[ P                  ,          ,          S[S[S[,          ,          ,          R,          RS[ P                  S[S[,          ,          S[S[ P                  ,          ,          S[S[S[,          ,          ,          R,          RS[S[,          S[,          RS[R,          RS[RS[R,          RS[R,          R	S[S[,          R,          R
S[R,          RS[	/
# )r   ÚaudioNÚaudio_targetÚpaddingÚ
max_lengthÚ
truncationÚpad_to_multiple_ofr   Úreturn_tensorsr   rA   ©
rC   rD   rB   r   r    r!   r	   r   r
   r   )r"   r#   s   "€r$   r%   r&   Ÿ   sü   ø€ ÷ rñ rá�z‰z™D¡�KÕ'©$©r¯z©zÕ*:Õ:¹TÁ$ÁuÅ+Õ=NÕNÐQUÕUðrñ —j‘j¡4©¥;Õ.±±b·j±jÕ1AÕAÁDÉÉeÍÕDUÕUÐX\Õ\ðrñ ™•™oÕ-ð	rñ
 ˜$•Jðrñ ðrñ   $�Jðrñ  $ d�{ðrñ ™jÕ(¨4Õ/ðrñ ˜T•zðrñ 
ñrr'   c
                óÜ  € Vf   Vf   \        R4      h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e   V P                  ! VR
VVVVVV3/ V
B pMRpVeF   V P                  ! VRVVVVVV3/ V
B pVf   V# VR,          VR&   VP                  R4      pVe   WÛR&   V# )a¶  
Main method to featurize and prepare for the model one or several sequence(s).

Pass in a value for `audio` to extract waveform features. Pass in a value for `audio_target` to extract log-mel
spectrogram features.

Args:
    audio (`np.ndarray`, `list[float]`, `list[np.ndarray]`, `list[list[float]]`, *optional*):
        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. This outputs waveform features. Must
        be mono channel audio, not stereo, i.e. single float per timestep.
    audio_target (`np.ndarray`, `list[float]`, `list[np.ndarray]`, `list[list[float]]`, *optional*):
        The sequence or batch of sequences to be processed as targets. 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. This outputs log-mel
        spectrogram features.
    padding (`bool`, `str` or [`~utils.PaddingStrategy`], *optional*, defaults to `False`):
        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*.
    pad_to_multiple_of (`int`, *optional*):
        If set will pad the sequence to a multiple of the provided value.

        This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability
        `>= 7.5` (Volta), or on TPUs which benefit from having sequence lengths be a multiple of 128.
    return_attention_mask (`bool`, *optional*):
        Whether to return the attention mask. If left to the default, will return the attention mask according
        to the specific feature_extractor's default.

        [What are attention masks?](../glossary#attention-mask)

    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` or `audio_target` input was sampled. It is strongly recommended
        to pass `sampling_rate` at the forward call to prevent silent errors.
Nz9You must provide either `audio` or `audio_target` values.z3The 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.FTr   Úlabelsr   Údecoder_attention_mask)Ú
ValueErrorr   ÚloggerÚwarningr>   Ú__name__Ú_process_audioÚget)r<   rc   rd   re   rf   rg   rh   r   ri   r   r=   ÚinputsÚinputs_targetrn   s   &&&&&&&&&&,   r$   Ú__call__Ú!SpeechT5FeatureExtractor.__call__Ÿ   sb  € ð| Š=˜\Ò1ÜÐXÓYÐYàÒ$Ø× 2Ñ 2Ô2Ü ØIÈ$Èð PØ×*Ñ*Ð+ð ,Ø×*Ñ*Ð+¨9°]°OÀ1ðFóð ð 3ô �N‰NØVÐW[×WeÑWe×WnÑWnÐVoð p\ð \ôð
 ÒØ×(Ò(ØØØØØØ"Ø%Øñ
ð ñ
‰Fð ˆFàÒ#Ø ×/Ò/ØØØØØØ"Ø%Øñ
ð ñ
ˆMð Š~Ø$Ð$à#0°Õ#@��xÑ Ø)6×):Ñ):Ð;KÓ)LÐ&Ø)Ò5Ø7MÐ3Ñ4àˆr'   c                óP  <€ V ^8„  d   QhRS[ P                  S[S[,          ,          S[S[ P                  ,          ,          S[S[S[,          ,          ,          RS[RS[S[,          S[,          RS[R,          RS[RS[R,          RS[R,          R	S[S[,          R,          R
S[	/	# )r   ÚspeechÚ	is_targetre   rf   Nrg   rh   r   ri   rA   rj   )r"   r#   s   "€r$   r%   r&     s¸   ø€ ÷ Uñ Uá—
‘
™T¡%�[Õ(©4±·
±
Õ+;Õ;¹dÁ4ÉÅ;Õ>OÕOðUñ ðUñ ™•™oÕ-ð	Uñ
 ˜$•JðUñ ðUñ   $�JðUñ  $ d�{ðUñ ™jÕ(¨4Õ/ðUñ 
ñUr'   c	                óŠ	  € \        V\        P                  4      ;'       d    \        VP                  4      ^8„  p
V
'       d)   \        VP                  4      ^8”  d   \        RV  24      hT
;'       gK    \        V\        \        34      ;'       d-    \        V^ ,          \        P                  \        \        34      pV'       d8   V Uu. uF)  p\        P                  ! V\        P                  R7      NK+  	  u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   V.pV P                  pV'       d?   V Uu. uF  qÐP                  V4      NK  	  pp\        RV/4      pV P                   V n        M\        RV/4      pV P"                  ! V3RVRVRVRVRV/V	B pWÀn        VR,          p\        V^ ,          \        P                  4      '       g<   V Uu. uF)  p\        P                  ! V\        P                  R7      NK+  	  upVR&   EM'\        V\        P                  4      '       g”   \        V^ ,          \        P                  4      '       dm   V^ ,          P                  \        P                  ! \        P                  4      J d4   V Uu. uF"  pVP                  \        P                  4      NK$  	  upVR&   Mt\        V\        P                  4      '       dU   VP                  \        P                  ! \        P                  4      J d#   VP                  \        P                  4      VR&   VP%                  R	4      pVe:   V Uu. uF)  p\        P                  ! V\        P&                  R7      NK+  	  upVR	&   V'       gc   V P(                  '       dQ   V P+                  W4R7      \,        P.                  Jd   TMR
pV P1                  VR,          VV P2                  R7      VR&   Ve   VP5                  V4      pV# u upi u upi u upi u upi u upi )é   z2Only mono-channel audio is supported for input to )Údtyper   re   rf   rg   rh   r   r   N)rf   )r   r   )Ú
isinstancerC   rD   ÚlenrN   ro   rB   ÚtupleÚasarrayÚfloat32r~   Úfloat64Úastyper   r`   r   r   Úpadrt   rH   r   Ú_get_padding_strategiesr	   Ú
DO_NOT_PADrU   r   Úconvert_to_tensors)r<   rz   r{   re   rf   rg   rh   r   ri   r=   Úis_batched_numpyÚ
is_batchedÚfeature_size_hackÚwaveformÚfeaturesÚencoded_inputsÚpadded_inputsr   rG   r   s   &&&&&&&&&,          r$   rs   Ú'SpeechT5FeatureExtractor._process_audio  sÇ  € ô & f¬b¯j©jÓ9×SÐS¼cÀ&Ç,Á,Ó>OÐRSÑ>SÐß¤ F§L¡LÓ 1°AÔ 5ÜÐQÐRVÐQWÐXÓYÐYØ%÷ 
ð 
Ü�v¤¤e˜}Ó-×dÐd´:¸fÀQ½iÌ"Ï*É*ÔV[Ô]aÐIbÓ3cð 	÷ ÙIOÓPÉ¸v”b—j’j ¬r¯z©z×:ÉÑP‰Fß¤J¨v´r·z±z×$BÒ$BÜ—Z’Z ¬b¯j©jÔ9‰FÜ˜¤§
¡
×+Ò+°·±ÄÇÂÌÏÉÓ@TÓ0TØ—]‘]¤2§:¡:Ó.ˆF÷ Ø�XˆFð !×-Ñ-Ð÷ ÙMSÓTÉVÀ×2Ñ2°8Ö<ÉVˆHÐTÜ)¨>¸8Ð*DÓEˆNØ $× 1Ñ 1ˆDÕä)¨>¸6Ð*BÓCˆNàŸšØñ
àð
ð "ð
ð "ð	
ð
  2ð
ð #8ð
ð ñ
ˆð .Ôð % ^Õ4ˆÜ˜, q�/¬2¯:©:×6Ò6Ù^jÓ,kÑ^jÐUZ¬R¯ZªZ¸ÄRÇZÁZ×-PÑ^jÑ,kˆM˜.Ó)ä˜<¬¯©×4Ò4Ü˜<¨�?¬B¯J©J×7Ò7Ø˜Q•×%Ñ%¬¯ª´"·*±*Ó)=Ó=áS_Ó,`ÑS_È%¨U¯\©\¼"¿*¹*Ö-EÑS_Ñ,`ˆM˜.Ò)Ü˜¤b§j¡j×1Ò1°l×6HÑ6HÌBÏHÊHÔUW×U_ÑU_ÓL`Ó6`Ø,8×,?Ñ,?ÄÇ
Á
Ó,KˆM˜.Ñ)ð '×*Ñ*Ð+;Ó<ˆØÒ%Ù^lÓ.mÑ^lÐUZ¬r¯zªz¸%ÄrÇxÁx×/PÑ^lÑ.mˆMÐ*Ñ+÷ ˜T×.×.Ð.ð ×/Ñ/°Ð/ÓOÔWf×WqÑWqÓqñ àð ð
 -1×,HÑ,HØ˜nÕ-¸nÐ\`×\nÑ\nð -Ió -ˆM˜.Ñ)ð Ò%Ø)×<Ñ<¸^ÓLˆMàÐùòC Qùò Uùò* -lùò -aùò /ns   Ã/R,Ç!R1É?/R6Ì:(R;Ï6/S c                ó6   <€ V ^8„  d   QhRS[ S[S[3,          /# )r   rA   )Údictr!   r   )r"   r#   s   "€r$   r%   r&   j  s   ø€ ÷ 	ñ 	™™c¡3˜h�ñ 	r'   c                óR   <€ \         SV `  4       p. ROpV F  pW19   g   K  W K  	  V# )r:   )r:   r;   r6   r7   r8   r9   )r4   Úto_dict)r<   ÚoutputÚnamesr*   r>   s   &   €r$   r•   Ú SpeechT5FeatureExtractor.to_dictj  s2   ø€ Ü‘‘Ó"ˆò ^ˆÛˆDØŽ~Ø’Lñ ð ˆr'   )r   r   r   r   r   r;   r   r8   r9   r   r   r6   r7   r   r   r:   )r}   i€>  ç        FéP   é   é@   Úhann_windowrš   i°  g»½×Ùß|Û=T)r™   )	NNFNFNNNN)FFNFNNN)rr   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Úmodel_input_namesr5   ÚstaticmethodrU   r`   rw   rs   r•   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r>   r#   s   @@r$   r   r      sp   ù‡ € ñ&ðP (Ð)9Ð:Ð÷+
õ +
ðZ ÷#ñ #ó ð#÷*ð ÷&rò r÷hUò U÷n	÷ 	ó 	r'   r   )r¡   Útypingr   ÚnumpyrC   Úaudio_utilsr   r   r   r   Ú!feature_extraction_sequence_utilsr   Úfeature_extraction_utilsr   Úutilsr	   r
   r   Ú
get_loggerrr   rp   r   Ú__all__r3   r'   r$   Ú<module>r¯      sN   ðñ ,å ã ç \Ó \Ý IÝ 4ß 9Ñ 9ð 
×	Ò	˜HÓ	%€ôVÐ7ô Vðr
 &Ð
&‚r'   