§
    @Äj�=  ã            	       ó(  — d dl Z d dlmZ d dlmZmZmZmZmZm	Z	 d dl
Z
d dl
mZ d dlmZ d dlmZ d dlmZmZ d dlmZmZ d	d
lmZ d	dlmZ g ZdZ G d„ dej        ¦  «        Z G d„ dej        ¦  «        Z G d„ de
j        j         ej!        ¦  «        Z" G d„ de
j        j         ej!        ¦  «        Z# G d„ d¦  «        Z$ G d„ d¦  «        Z%e G d„ d¦  «        ¦   «         Z&e G d„ d¦  «        ¦   «         Z' G d„ d¦  «        Z(e G d„ d e'e&e$e¦  «        ¦   «         Z)e G d!„ d"e'e&e%e¦  «        ¦   «         Z*e G d#„ d$e(e&e$e¦  «        ¦   «         Z+e G d%„ d&e(e&e%e¦  «        ¦   «         Z, e+d' ej-        d(¬)¦  «        ¬*¦  «        Z.d+e._/         e,d, ej-        d-¬)¦  «        ¬*¦  «        Z0d.e0_/         e)d/ ej-        d(¬)¦  «        d0 ej1        ¦   «         ¬1¦  «        Z2d2e2_/         e*d3 ej-        d-¬)¦  «        d0 ej1        ¦   «         ¬1¦  «        Z3d4e3_/        dS )5é    N)Ú	dataclass)ÚAnyÚDictÚListÚOptionalÚTupleÚUnion)ÚTensor)Úload_state_dict_from_url)Úmu_law_decoding)Ú	Tacotron2ÚWaveRNN)Ú
GriffinLimÚInverseMelScaleé   )Úutils)ÚTacotron2TTSBundlez.https://download.pytorch.org/torchaudio/modelsc                   óp   ‡ — e Zd Zˆ fd„Zed„ ¦   «         Zdeeee         f         de	e
e
f         fd„Zˆ xZS )Ú_EnglishCharProcessorc                 ó¾   •— t          ¦   «                              ¦   «          t          j        ¦   «         | _        d„ t          | j        ¦  «        D ¦   «         | _        d S )Nc                 ó   — i | ]\  }}||“Œ	S © r   )Ú.0ÚiÚss      úOC:\Projects\Historical\venv\Lib\site-packages\torchaudio/pipelines/_tts/impl.pyú
<dictcomp>z2_EnglishCharProcessor.__init__.<locals>.<dictcomp>   ó   € ÐBÐBÐB¡$ ! Q˜˜AÐBÐBÐBó    )ÚsuperÚ__init__r   Ú
_get_charsÚ_tokensÚ	enumerateÚ_mapping©ÚselfÚ	__class__s    €r   r!   z_EnglishCharProcessor.__init__   sL   ø€ Ý‰Œ×ÒÑÔÐÝÔ'Ñ)Ô)ˆŒØBÐB­)°D´LÑ*AÔ*AÐBÑBÔBˆŒˆˆr   c                 ó   — | j         S ©N©r#   ©r'   s    r   Útokensz_EnglishCharProcessor.tokens   ó
   € àŒ|Ðr   ÚtextsÚreturnc                 óx   ‡ — t          |t          ¦  «        r|g}ˆ fd„|D ¦   «         }t          j        |¦  «        S )Nc                 óP   •— g | ]"}ˆfd „|                      ¦   «         D ¦   «         ‘Œ#S )c                 ó<   •— g | ]}|‰j         v ¯‰j         |         ‘ŒS r   ©r%   )r   Úcr'   s     €r   ú
<listcomp>z=_EnglishCharProcessor.__call__.<locals>.<listcomp>.<listcomp>&   s,   ø€ ÐNÐNÐN¨¸1ÀÄÐ;MÐ;M�D”M !Ô$Ð;MÐ;MÐ;Mr   )Úlower)r   Útr'   s     €r   r6   z2_EnglishCharProcessor.__call__.<locals>.<listcomp>&   s7   ø€ Ð^Ð^Ð^ÐSTÐNÐNÐNÐN¨a¯gªg©i¬iÐNÑNÔNÐ^Ð^Ð^r   )Ú
isinstanceÚstrr   Ú
_to_tensor)r'   r/   Úindicess   `  r   Ú__call__z_EnglishCharProcessor.__call__#   sG   ø€ Ý�e�SÑ!Ô!ð 	Ø�GˆEØ^Ð^Ð^Ð^ÐX]Ð^Ñ^Ô^ˆÝÔ Ñ(Ô(Ð(r   ©Ú__name__Ú
__module__Ú__qualname__r!   Úpropertyr-   r	   r:   r   r   r
   r=   Ú__classcell__©r(   s   @r   r   r      s�   ø€ € € € € ðCð Cð Cð Cð Cð
 ðð ñ „Xðð)˜e C¨¨c¬ NÔ3ð )¸¸fÀf¸nÔ8Mð )ð )ð )ð )ð )ð )ð )ð )r   r   c                   óv   ‡ — e Zd Zddœˆ fd„
Zed„ ¦   «         Zdeeee         f         de	e
e
f         fd„Zˆ xZS )Ú_EnglishPhoneProcessorN©Ú	dl_kwargsc                ó  •— t          ¦   «                              ¦   «          t          j        ¦   «         | _        d„ t          | j        ¦  «        D ¦   «         | _        t          j        d|¬¦  «        | _        d| _	        d S )Nc                 ó   — i | ]\  }}||“Œ	S r   r   )r   r   Úps      r   r   z3_EnglishPhoneProcessor.__init__.<locals>.<dictcomp>.   r   r   zen_us_cmudict_forward.ptrG   z(\[[A-Z]+?\]|[_!'(),.:;? -]))
r    r!   r   Ú_get_phonesr#   r$   r%   Ú_load_phonemizerÚ_phonemizerÚ_pattern)r'   rH   r(   s     €r   r!   z_EnglishPhoneProcessor.__init__+   sm   ø€ Ý‰Œ×ÒÑÔÐÝÔ(Ñ*Ô*ˆŒØBÐB­)°D´LÑ*AÔ*AÐBÑBÔBˆŒÝ Ô1Ð2LÐXaÐbÑbÔbˆÔØ7ˆŒˆˆr   c                 ó   — | j         S r*   r+   r,   s    r   r-   z_EnglishPhoneProcessor.tokens2   r.   r   r/   r0   c                 ó  ‡ — t          |t          ¦  «        r|g}g }‰                      |d¬¦  «        D ]G}d„ t          j        ‰ j        |¦  «        D ¦   «         }|                     ˆ fd„|D ¦   «         ¦  «         ŒHt          j        |¦  «        S )NÚen_us)Úlangc                 ó:   — g | ]}t          j        d d|¦  «        ‘ŒS )z[\[\]]Ú )ÚreÚsub)r   Úrs     r   r6   z3_EnglishPhoneProcessor.__call__.<locals>.<listcomp>=   s&   € ÐWÐWÐW°•2”6˜) R¨Ñ+Ô+ÐWÐWÐWr   c                 ó*   •— g | ]}‰j         |         ‘ŒS r   r4   )r   rK   r'   s     €r   r6   z3_EnglishPhoneProcessor.__call__.<locals>.<listcomp>>   s    ø€ Ð:Ð:Ð:°˜DœM¨!Ô,Ð:Ð:Ð:r   )	r9   r:   rN   rV   ÚfindallrO   Úappendr   r;   )r'   r/   r<   ÚphonesÚrets   `    r   r=   z_EnglishPhoneProcessor.__call__6   sŸ   ø€ Ý�e�SÑ!Ô!ð 	Ø�GˆEàˆØ×&Ò& u°7Ð&Ñ;Ô;ð 	<ð 	<ˆFàWÐWµR´ZÀÄÈvÑ5VÔ5VÐWÑWÔWˆCØ�NŠNÐ:Ð:Ð:Ð:°cÐ:Ñ:Ô:Ñ;Ô;Ð;Ð;ÝÔ Ñ(Ô(Ð(r   r>   rD   s   @r   rF   rF   *   s˜   ø€ € € € € Ø$(ð 8ð 8ð 8ð 8ð 8ð 8ð 8ð ðð ñ „Xðð	)˜e C¨¨c¬ NÔ3ð 	)¸¸fÀf¸nÔ8Mð 	)ð 	)ð 	)ð 	)ð 	)ð 	)ð 	)ð 	)r   rF   c                   óT   ‡ — e Zd Zddedee         fˆ fd„Zed„ ¦   «         Zd	d„Z	ˆ xZ
S )
Ú_WaveRNNVocoderéœÿÿÿÚmodelÚmin_level_dbc                 ór   •— t          ¦   «                              ¦   «          d| _        || _        || _        d S )Né"V  )r    r!   Ú_sample_rateÚ_modelÚ_min_level_db)r'   ra   rb   r(   s      €r   r!   z_WaveRNNVocoder.__init__H   s6   ø€ Ý‰Œ×ÒÑÔÐØ!ˆÔØˆŒØ)ˆÔÐÐr   c                 ó   — | j         S r*   ©re   r,   s    r   Úsample_ratez_WaveRNNVocoder.sample_rateN   ó   € àÔ Ð r   Nc                 óÀ  — t          j        |¦  «        }dt          j        t          j        |d¬¦  «        ¦  «        z  }| j        �)| j        |z
  | j        z  }t          j        |dd¬¦  «        }| j                             ||¦  «        \  }}t          j        || j        j	        ¦  «        }t          || j        j        ¦  «        }|                     d¦  «        }||fS )Né   gñhãˆµøä>)Úminr   r   )rn   Úmax)ÚtorchÚexpÚlog10Úclamprg   rf   Úinferr   Ú_unnormalize_waveformÚn_bitsr   Ú	n_classesÚsqueeze)r'   Úmel_specÚlengthsÚwaveforms       r   Úforwardz_WaveRNNVocoder.forwardR   sÍ   € Ý”9˜XÑ&Ô&ˆØ�œ¥E¤K°¸dÐ$CÑ$CÔ$CÑDÔDÑDˆØÔÐ)ØÔ*¨XÑ5¸Ô9KÑKˆHÝ”{ 8°¸Ð:Ñ:Ô:ˆHØ œK×-Ò-¨h¸Ñ@Ô@Ñˆ�'ÝÔ.¨x¸¼Ô9KÑLÔLˆÝ" 8¨T¬[Ô-BÑCÔCˆØ×#Ò# AÑ&Ô&ˆØ˜Ð Ð r   )r`   r*   )r?   r@   rA   r   r   Úfloatr!   rB   rj   r|   rC   rD   s   @r   r_   r_   G   sƒ   ø€ € € € € ð*ð *˜gð *°X¸e´_ð *ð *ð *ð *ð *ð *ð ð!ð !ñ „Xð!ð
!ð 
!ð 
!ð 
!ð 
!ð 
!ð 
!ð 
!r   r_   c                   ó<   ‡ — e Zd Zˆ fd„Zed„ ¦   «         Zdd„Zˆ xZS )Ú_GriffinLimVocoderc           	      óÆ   •— t          ¦   «                              ¦   «          d| _        t          dd| j        dddd¬¦  «        | _        t          dd	d
d¬¦  «        | _        d S )Nrd   i  éP   g        g     @¿@Úslaney)Ún_stftÚn_melsrj   Úf_minÚf_maxÚ	mel_scaleÚnormi   r   é   )Ún_fftÚpowerÚ
hop_lengthÚ
win_length)r    r!   re   r   rj   Ú_inv_melr   Ú_griffin_limr&   s    €r   r!   z_GriffinLimVocoder.__init__`   sz   ø€ Ý‰Œ×ÒÑÔÐØ!ˆÔÝ'Ø!ØØÔ(ØØØØð
ñ 
ô 
ˆŒõ 'ØØØØð	
ñ 
ô 
ˆÔÐÐr   c                 ó   — | j         S r*   ri   r,   s    r   rj   z_GriffinLimVocoder.sample_rates   rk   r   Nc                 óF  — t          j        |¦  «        }|                     ¦   «                              ¦   «                              d¦  «        }|                      |¦  «        }|                     ¦   «                              d¦  «        }|                      |¦  «        }||fS )NTF)rp   rq   ÚcloneÚdetachÚrequires_grad_rŽ   r�   )r'   ry   rz   ÚspecÚ	waveformss        r   r|   z_GriffinLimVocoder.forwardw   s„   € Ý”9˜XÑ&Ô&ˆØ—>’>Ñ#Ô#×*Ò*Ñ,Ô,×;Ò;¸DÑAÔAˆØ�}Š}˜XÑ&Ô&ˆØ�{Š{‰}Œ}×+Ò+¨EÑ2Ô2ˆØ×%Ò% dÑ+Ô+ˆ	Ø˜'Ð!Ð!r   r*   )r?   r@   rA   r!   rB   rj   r|   rC   rD   s   @r   r   r   _   sg   ø€ € € € € ð
ð 
ð 
ð 
ð 
ð& ð!ð !ñ „Xð!ð"ð "ð "ð "ð "ð "ð "ð "r   r   c                   ó$   — e Zd Zdej        fd„ZdS )Ú
_CharMixinr0   c                 ó   — t          ¦   «         S r*   )r   r,   s    r   Úget_text_processorz_CharMixin.get_text_processor†   s   € Ý$Ñ&Ô&Ð&r   N©r?   r@   rA   r   ÚTextProcessorrš   r   r   r   r˜   r˜   …   s3   € € € € € ð'Ð$6Ô$Dð 'ð 'ð 'ð 'ð 'ð 'r   r˜   c                   ó*   — e Zd Zddœdej        fd„ZdS )Ú_PhoneMixinNrG   r0   c                ó"   — t          |¬¦  «        S ©NrG   )rF   )r'   rH   s     r   rš   z_PhoneMixin.get_text_processor‹   s   € Ý%°	Ð:Ñ:Ô:Ð:r   r›   r   r   r   rž   rž   Š   s@   € € € € € Ø.2ð ;ð ;ð ;Ð7IÔ7Wð ;ð ;ð ;ð ;ð ;ð ;r   rž   c                   óF   — e Zd ZU eed<   eeef         ed<   ddœdefd„ZdS )Ú_Tacotron2MixinÚ_tacotron2_pathÚ_tacotron2_paramsNrG   r0   c                óÂ   — t          di | j        ¤Ž}t          › d| j        › �}|€i n|}t	          |fi |¤Ž}|                     |¦  «         |                     ¦   «          |S ©Nú/r   )r   r¤   Ú	_BASE_URLr£   r   Úload_state_dictÚeval©r'   rH   ra   ÚurlÚ
state_dicts        r   Úget_tacotron2z_Tacotron2Mixin.get_tacotron2”   sw   € ÝÐ3Ð3˜DÔ2Ð3Ð3ˆÝÐ3Ð3˜TÔ1Ð3Ð3ˆØ#Ð+�B�B°ˆ	Ý-¨cÐ?Ð?°YÐ?Ð?ˆ
Ø×Ò˜jÑ)Ô)Ð)Ø�
Š
‰ŒˆØˆr   )	r?   r@   rA   r:   Ú__annotations__r   r   r   r®   r   r   r   r¢   r¢   �   s^   € € € € € € àÐÐÑØ˜C ˜H”~Ð%Ð%Ñ%à)-ð ð ð °)ð ð ð ð ð ð r   r¢   c                   ód   — e Zd ZU ee         ed<   eeeef                  ed<   ddœd„Zddœd„Z	dS )Ú_WaveRNNMixinÚ_wavernn_pathÚ_wavernn_paramsNrG   c                óL   — |                       |¬¦  «        }t          |¦  «        S r    )Ú_get_wavernnr_   )r'   rH   Úwavernns      r   Úget_vocoderz_WaveRNNMixin.get_vocoder£   s&   € Ø×#Ò#¨iÐ#Ñ8Ô8ˆÝ˜wÑ'Ô'Ð'r   c                óÂ   — t          di | j        ¤Ž}t          › d| j        › �}|€i n|}t	          |fi |¤Ž}|                     |¦  «         |                     ¦   «          |S r¦   )r   r³   r¨   r²   r   r©   rª   r«   s        r   rµ   z_WaveRNNMixin._get_wavernn§   sw   € ÝÐ/Ð/˜$Ô.Ð/Ð/ˆÝÐ1Ð1˜TÔ/Ð1Ð1ˆØ#Ð+�B�B°ˆ	Ý-¨cÐ?Ð?°YÐ?Ð?ˆ
Ø×Ò˜jÑ)Ô)Ð)Ø�
Š
‰ŒˆØˆr   )
r?   r@   rA   r   r:   r¯   r   r   r·   rµ   r   r   r   r±   r±   ž   sy   € € € € € € à˜C”=Ð Ð Ñ Ø˜d 3¨ 8œnÔ-Ð-Ð-Ñ-à'+ð (ð (ð (ð (ð (ð )-ð ð ð ð ð ð ð r   r±   c                   ó   — e Zd Zd„ ZdS )Ú_GriffinLimMixinc                 ó   — t          ¦   «         S r*   )r   )r'   Ú_s     r   r·   z_GriffinLimMixin.get_vocoder²   s   € Ý!Ñ#Ô#Ð#r   N)r?   r@   rA   r·   r   r   r   rº   rº   ±   s#   € € € € € ð$ð $ð $ð $ð $r   rº   c                   ó   — e Zd ZdS )Ú_Tacotron2WaveRNNCharBundleN©r?   r@   rA   r   r   r   r¾   r¾   »   ó   € € € € € à€Dr   r¾   c                   ó   — e Zd ZdS )Ú_Tacotron2WaveRNNPhoneBundleNr¿   r   r   r   rÂ   rÂ   À   rÀ   r   rÂ   c                   ó   — e Zd ZdS )Ú_Tacotron2GriffinLimCharBundleNr¿   r   r   r   rÄ   rÄ   Å   rÀ   r   rÄ   c                   ó   — e Zd ZdS )Ú_Tacotron2GriffinLimPhoneBundleNr¿   r   r   r   rÆ   rÆ   Ê   rÀ   r   rÆ   z5tacotron2_english_characters_1500_epochs_ljspeech.pthé&   )Ú	n_symbols)r£   r¤   aþ  Character-based TTS pipeline with :py:class:`~torchaudio.models.Tacotron2` trained on *LJSpeech* :cite:`ljspeech17` for 1,500 epochs, and
:py:class:`~torchaudio.transforms.GriffinLim` as vocoder.

The text processor encodes the input texts character-by-character.

You can find the training script `here <https://github.com/pytorch/audio/tree/main/examples/pipeline_tacotron2>`__.
The default parameters were used.

Please refer to :func:`torchaudio.pipelines.Tacotron2TTSBundle` for the usage.

Example - "Hello world! T T S stands for Text to Speech!"

   .. image:: https://download.pytorch.org/torchaudio/doc-assets/TACOTRON2_GRIFFINLIM_CHAR_LJSPEECH.png
      :alt: Spectrogram generated by Tacotron2

   .. raw:: html

      <audio controls="controls">
         <source src="https://download.pytorch.org/torchaudio/doc-assets/TACOTRON2_GRIFFINLIM_CHAR_LJSPEECH.wav" type="audio/wav">
         Your browser does not support the <code>audio</code> element.
      </audio>

Example - "The examination and testimony of the experts enabled the Commission to conclude that five shots may have been fired,"

   .. image:: https://download.pytorch.org/torchaudio/doc-assets/TACOTRON2_GRIFFINLIM_CHAR_LJSPEECH_v2.png
      :alt: Spectrogram generated by Tacotron2

   .. raw:: html

      <audio controls="controls">
         <source src="https://download.pytorch.org/torchaudio/doc-assets/TACOTRON2_GRIFFINLIM_CHAR_LJSPEECH_v2.wav" type="audio/wav">
         Your browser does not support the <code>audio</code> element.
      </audio>
z3tacotron2_english_phonemes_1500_epochs_ljspeech.pthé`   aè  Phoneme-based TTS pipeline with :py:class:`~torchaudio.models.Tacotron2` trained on *LJSpeech* :cite:`ljspeech17` for 1,500 epochs and
:py:class:`~torchaudio.transforms.GriffinLim` as vocoder.

The text processor encodes the input texts based on phoneme.
It uses `DeepPhonemizer <https://github.com/as-ideas/DeepPhonemizer>`__ to convert
graphemes to phonemes.
The model (*en_us_cmudict_forward*) was trained on
`CMUDict <http://www.speech.cs.cmu.edu/cgi-bin/cmudict>`__.

You can find the training script `here <https://github.com/pytorch/audio/tree/main/examples/pipeline_tacotron2>`__.
The text processor is set to the *"english_phonemes"*.

Please refer to :func:`torchaudio.pipelines.Tacotron2TTSBundle` for the usage.

Example - "Hello world! T T S stands for Text to Speech!"

   .. image:: https://download.pytorch.org/torchaudio/doc-assets/TACOTRON2_GRIFFINLIM_PHONE_LJSPEECH.png
      :alt: Spectrogram generated by Tacotron2

   .. raw:: html

      <audio controls="controls">
         <source src="https://download.pytorch.org/torchaudio/doc-assets/TACOTRON2_GRIFFINLIM_PHONE_LJSPEECH.wav" type="audio/wav">
         Your browser does not support the <code>audio</code> element.
      </audio>

Example - "The examination and testimony of the experts enabled the Commission to conclude that five shots may have been fired,"

   .. image:: https://download.pytorch.org/torchaudio/doc-assets/TACOTRON2_GRIFFINLIM_PHONE_LJSPEECH_v2.png
      :alt: Spectrogram generated by Tacotron2

   .. raw:: html

      <audio controls="controls">
         <source src="https://download.pytorch.org/torchaudio/doc-assets/TACOTRON2_GRIFFINLIM_PHONE_LJSPEECH_v2.wav" type="audio/wav">
         Your browser does not support the <code>audio</code> element.
      </audio>

z=tacotron2_english_characters_1500_epochs_wavernn_ljspeech.pthz%wavernn_10k_epochs_8bits_ljspeech.pth)r£   r¤   r²   r³   a  Character-based TTS pipeline with :py:class:`~torchaudio.models.Tacotron2` trained on *LJSpeech* :cite:`ljspeech17` for 1,500 epochs and :py:class:`~torchaudio.models.WaveRNN` vocoder trained on 8 bits depth waveform of *LJSpeech* :cite:`ljspeech17` for 10,000 epochs.

The text processor encodes the input texts character-by-character.

You can find the training script `here <https://github.com/pytorch/audio/tree/main/examples/pipeline_tacotron2>`__.
The following parameters were used; ``win_length=1100``, ``hop_length=275``, ``n_fft=2048``,
``mel_fmin=40``, and ``mel_fmax=11025``.

You can find the training script `here <https://github.com/pytorch/audio/tree/main/examples/pipeline_wavernn>`__.

Please refer to :func:`torchaudio.pipelines.Tacotron2TTSBundle` for the usage.

Example - "Hello world! T T S stands for Text to Speech!"

   .. image:: https://download.pytorch.org/torchaudio/doc-assets/TACOTRON2_WAVERNN_CHAR_LJSPEECH.png
      :alt: Spectrogram generated by Tacotron2

   .. raw:: html

      <audio controls="controls">
         <source src="https://download.pytorch.org/torchaudio/doc-assets/TACOTRON2_WAVERNN_CHAR_LJSPEECH.wav" type="audio/wav">
         Your browser does not support the <code>audio</code> element.
      </audio>

Example - "The examination and testimony of the experts enabled the Commission to conclude that five shots may have been fired,"

   .. image:: https://download.pytorch.org/torchaudio/doc-assets/TACOTRON2_WAVERNN_CHAR_LJSPEECH_v2.png
      :alt: Spectrogram generated by Tacotron2

   .. raw:: html

      <audio controls="controls">
         <source src="https://download.pytorch.org/torchaudio/doc-assets/TACOTRON2_WAVERNN_CHAR_LJSPEECH_v2.wav" type="audio/wav">
         Your browser does not support the <code>audio</code> element.
      </audio>
z;tacotron2_english_phonemes_1500_epochs_wavernn_ljspeech.ptha  Phoneme-based TTS pipeline with :py:class:`~torchaudio.models.Tacotron2` trained on *LJSpeech* :cite:`ljspeech17` for 1,500 epochs, and
:py:class:`~torchaudio.models.WaveRNN` vocoder trained on 8 bits depth waveform of *LJSpeech* :cite:`ljspeech17` for 10,000 epochs.

The text processor encodes the input texts based on phoneme.
It uses `DeepPhonemizer <https://github.com/as-ideas/DeepPhonemizer>`__ to convert
graphemes to phonemes.
The model (*en_us_cmudict_forward*) was trained on
`CMUDict <http://www.speech.cs.cmu.edu/cgi-bin/cmudict>`__.

You can find the training script for Tacotron2 `here <https://github.com/pytorch/audio/tree/main/examples/pipeline_tacotron2>`__.
The following parameters were used; ``win_length=1100``, ``hop_length=275``, ``n_fft=2048``,
``mel_fmin=40``, and ``mel_fmax=11025``.

You can find the training script for WaveRNN `here <https://github.com/pytorch/audio/tree/main/examples/pipeline_wavernn>`__.

Please refer to :func:`torchaudio.pipelines.Tacotron2TTSBundle` for the usage.

Example - "Hello world! T T S stands for Text to Speech!"

   .. image:: https://download.pytorch.org/torchaudio/doc-assets/TACOTRON2_WAVERNN_PHONE_LJSPEECH.png
      :alt: Spectrogram generated by Tacotron2

   .. raw:: html

      <audio controls="controls">
         <source src="https://download.pytorch.org/torchaudio/doc-assets/TACOTRON2_WAVERNN_PHONE_LJSPEECH.wav" type="audio/wav">
         Your browser does not support the <code>audio</code> element.
      </audio>


Example - "The examination and testimony of the experts enabled the Commission to conclude that five shots may have been fired,"

   .. image:: https://download.pytorch.org/torchaudio/doc-assets/TACOTRON2_WAVERNN_PHONE_LJSPEECH_v2.png
      :alt: Spectrogram generated by Tacotron2

   .. raw:: html

      <audio controls="controls">
         <source src="https://download.pytorch.org/torchaudio/doc-assets/TACOTRON2_WAVERNN_PHONE_LJSPEECH_v2.wav" type="audio/wav">
         Your browser does not support the <code>audio</code> element.
      </audio>
)4rV   Údataclassesr   Útypingr   r   r   r   r   r	   rp   r
   Útorchaudio._internalr   Útorchaudio.functionalr   Útorchaudio.modelsr   r   Útorchaudio.transformsr   r   rU   r   Ú	interfacer   Ú__all__r¨   rœ   r   rF   ÚnnÚModuleÚVocoderr_   r   r˜   rž   r¢   r±   rº   r¾   rÂ   rÄ   rÆ   Ú_get_taco_paramsÚ"TACOTRON2_GRIFFINLIM_CHAR_LJSPEECHÚ__doc__Ú#TACOTRON2_GRIFFINLIM_PHONE_LJSPEECHÚ_get_wrnn_paramsÚTACOTRON2_WAVERNN_CHAR_LJSPEECHÚ TACOTRON2_WAVERNN_PHONE_LJSPEECHr   r   r   ú<module>rÜ      s¢  ðØ 	€	€	€	Ø !Ð !Ð !Ð !Ð !Ð !Ø :Ð :Ð :Ð :Ð :Ð :Ð :Ð :Ð :Ð :Ð :Ð :Ð :Ð :Ð :Ð :à €€€Ø Ð Ð Ð Ð Ð Ø 9Ð 9Ð 9Ð 9Ð 9Ð 9Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø =Ð =Ð =Ð =Ð =Ð =Ð =Ð =à Ð Ð Ð Ð Ð Ø )Ð )Ð )Ð )Ð )Ð )à
€à<€	ð)ð )ð )ð )ð )Ð.Ô<ñ )ô )ð )ð")ð )ð )ð )ð )Ð/Ô=ñ )ô )ð )ð:!ð !ð !ð !ð !�e”h”oÐ'9Ô'Añ !ô !ð !ð0"ð "ð "ð "ð "˜œœÐ*<Ô*Dñ "ô "ð "ðL'ð 'ð 'ð 'ð 'ñ 'ô 'ð 'ð
;ð ;ð ;ð ;ð ;ñ ;ô ;ð ;ð
 ðð ð ð ð ñ ô ñ „ðð ðð ð ð ð ñ ô ñ „ðð$$ð $ð $ð $ð $ñ $ô $ð $ð ð	ð 	ð 	ð 	ð 	 -°À*ÐN`ñ 	ô 	ñ „ð	ð ð	ð 	ð 	ð 	ð 	 =°/À;ÐPbñ 	ô 	ñ „ð	ð ð	ð 	ð 	ð 	ð 	Ð%5°È
ÐTfñ 	ô 	ñ „ð	ð ð	ð 	ð 	ð 	ð 	Ð&6¸ÈÐVhñ 	ô 	ñ „ð	ð &DÐ%CØKØ,�eÔ,°rÐ:Ñ:Ô:ð&ñ &ô &Ð "ð!.Ð "Ô *ðF 'FÐ&EØIØ,�eÔ,°rÐ:Ñ:Ô:ð'ñ 'ô 'Ð #ð&/Ð #Ô +ðP #>Ð"=ØSØ,�eÔ,°rÐ:Ñ:Ô:Ø9Ø*�EÔ*Ñ,Ô,ð	#ñ #ô #Ð ð#+Ð Ô 'ðJ $@Ð#?ØQØ,�eÔ,°rÐ:Ñ:Ô:Ø9Ø*�EÔ*Ñ,Ô,ð	$ñ $ô $Ð  ð),Ð  Ô (Ð (Ð (r   