o
    
j                     @   s   d dl Z d dlmZ d dlmZmZmZ defddZddedee	 fd	d
Z
defddZddedee fddZdefddZddedefddZdS )    N)Optional)download_kaggle_datasetdownload_urlextract_archivepathc                 C   J   t j| dd d}t||  t j|}t j| |}td t| dS )zDownload and extract LJSpeech dataset

    Args:
        path (str): path to the directory where the dataset will be stored.
    Texist_okz:https://data.keithito.com/data/speech/LJSpeech-1.1.tar.bz2 > Extracting archive file...Nosmakedirsr   r   basenamejoinprintr   r   urlr   archive r   H/home/kuhnn/.local/lib/python3.10/site-packages/TTS/utils/downloaders.pydownload_ljspeech      
r   F
use_kagglec                 C   s^   |r
t dd|  dS tj| dd d}t||  tj|}tj| |}td t| dS )zDownload and extract VCTK dataset.

    Args:
        path (str): path to the directory where the dataset will be stored.

        use_kaggle (bool, optional): Downloads vctk dataset from kaggle. Is generally faster. Defaults to False.
    z5mfekadu/english-multispeaker-corpus-for-voice-cloningVCTKTr   zKhttps://datashare.ed.ac.uk/bitstream/handle/10283/3443/VCTK-Corpus-0.92.zipr
   N)	r   r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   download_vctk   s   
r   c                 C   s   t dd|  dS )z}Download and extract Tweb dataset

    Args:
        path (str): Path to the directory where the dataset will be stored.
    z0bryanpark/the-world-english-bible-speech-datasetTWEBN)r   )r   r   r   r   download_tweb*   s   r   allsubsetc                 C   s   dddddddd}t j| d	d
 |dkrF| D ]&\}}td| d t||  t j|}t j| |}td t| qtd dS || }t||  t j|}t j| |}td t| dS )a  Download and extract libri tts dataset.

    Args:
        path (str): Path to the directory where the dataset will be stored.

        subset (str, optional): Name of the subset to download. If you only want to download a certain
        portion specify it here. Defaults to 'all'.
    z:http://www.openslr.org/resources/60/train-clean-100.tar.gzz:http://www.openslr.org/resources/60/train-clean-360.tar.gzz:http://www.openslr.org/resources/60/train-other-500.tar.gzz4http://www.openslr.org/resources/60/dev-clean.tar.gzz4http://www.openslr.org/resources/60/dev-other.tar.gzz5http://www.openslr.org/resources/60/test-clean.tar.gzz5http://www.openslr.org/resources/60/test-other.tar.gz)zlibri-tts-clean-100zlibri-tts-clean-360zlibri-tts-other-500zlibri-tts-dev-cleanzlibri-tts-dev-otherzlibri-tts-test-cleanzlibri-tts-test-otherTr   r   z > Downloading z...r
   z > All subsets downloadedN)	r   r   itemsr   r   r   r   r   r   )r   r   subset_dictsubvalr   r   r   r   r   r   download_libri_tts3   s0   



r#   c                 C   r   )zDownload and extract Thorsten german male voice dataset.

    Args:
        path (str): Path to the directory where the dataset will be stored.
    Tr   z8https://www.openslr.org/resources/95/thorsten-de_v02.tgzr
   Nr   r   r   r   r   download_thorsten_deZ   r   r$   englishlanguagec                 C   s^   dddddd}t j| dd || }t||  t j|}t j| |}td	 t| d
S )zDownload and extract Mailabs dataset.

    Args:
        path (str): Path to the directory where the dataset will be stored.

        language (str): Language subset to download. Defaults to english.
    z5https://data.solak.de/data/Training/stt_tts/en_US.tgzz5https://data.solak.de/data/Training/stt_tts/de_DE.tgzz5https://data.solak.de/data/Training/stt_tts/fr_FR.tgzz5https://data.solak.de/data/Training/stt_tts/it_IT.tgzz5https://data.solak.de/data/Training/stt_tts/es_ES.tgz)r%   germanfrenchitalianspanishTr   r
   Nr   )r   r&   language_dictr   r   r   r   r   r   download_mailabsi   s   	
r,   )F)r   )r%   )r   typingr   TTS.utils.downloadr   r   r   strr   boolr   r   r#   r$   r,   r   r   r   r   <module>   s    	'