TTS MultiLingual
1.0.0
pip install TTSหากคุณวางแผนที่จะเขียนโค้ดหรือฝึกอบรมโมเดลให้โคลน TTS และติดตั้งในเครื่อง
git clone https://github.com/saba99/TTS-MultiLingual
pip install -e .[all,dev,notebooks] # Select the relevant extrasหากคุณอยู่ใน Ubuntu (Debian) คุณสามารถเรียกใช้คำสั่งต่อไปนี้สำหรับการติดตั้ง
$ make system-deps # intended to be used on Ubuntu (Debian). Let us know if you have a different OS.
$ make install from TTS . api import TTS
# Running a multi-speaker and multi-lingual model
# List available TTS models and choose the first one
model_name = TTS . list_models ()[ 0 ]
# Init TTS
tts = TTS ( model_name )
# Run TTS
# Since this model is multi-speaker and multi-lingual, we must set the target speaker and the language
# Text to speech with a numpy output
wav = tts . tts ( "This is a test! This is also a test!!" , speaker = tts . speakers [ 0 ], language = tts . languages [ 0 ])
# Text to speech to a file
tts . tts_to_file ( text = "Hello world!" , speaker = tts . speakers [ 0 ], language = tts . languages [ 0 ], file_path = "output.wav" )
# Running a single speaker model
# Init TTS with the target model name
tts = TTS ( model_name = "tts_models/de/thorsten/tacotron2-DDC" , progress_bar = False , gpu = False )
# Run TTS
tts . tts_to_file ( text = "Ich bin eine Testnachricht." , file_path = OUTPUT_PATH )
# Example voice cloning with YourTTS in English, French and Portuguese:
tts = TTS ( model_name = "tts_models/multilingual/multi-dataset/your_tts" , progress_bar = False , gpu = True )
tts . tts_to_file ( "This is voice cloning." , speaker_wav = "my/cloning/audio.wav" , language = "en" , file_path = "output.wav" )
tts . tts_to_file ( "C'est le clonage de la voix." , speaker_wav = "my/cloning/audio.wav" , language = "fr-fr" , file_path = "output.wav" )
tts . tts_to_file ( "Isso é clonagem de voz." , speaker_wav = "my/cloning/audio.wav" , language = "pt-br" , file_path = "output.wav" )
# Example voice conversion converting speaker of the `source_wav` to the speaker of the `target_wav`
tts = TTS ( model_name = "voice_conversion_models/multilingual/vctk/freevc24" , progress_bar = False , gpu = True )
tts . voice_conversion_to_file ( source_wav = "my/source.wav" , target_wav = "my/target.wav" , file_path = "output.wav" )
# Example voice cloning by a single speaker TTS model combining with the voice conversion model. This way, you can
# clone voices by using any model in TTS.
tts = TTS ( "tts_models/de/thorsten/tacotron2-DDC" )
tts . tts_with_vc_to_file (
"Wie sage ich auf Italienisch, dass ich dich liebe?" ,
speaker_wav = "target/speaker.wav" ,
file_path = "ouptut.wav"
)
# Example text to speech using [Coqui Studio](https://coqui.ai) models. You can use all of your available speakers in the studio.
# [Coqui Studio](https://coqui.ai) API token is required. You can get it from the [account page](https://coqui.ai/account).
# You should set the `COQUI_STUDIO_TOKEN` environment variable to use the API token.
# If you have a valid API token set you will see the studio speakers as separate models in the list.
# The name format is coqui_studio/en/<studio_speaker_name>/coqui_studio
models = TTS (). list_models ()
# Init TTS with the target studio speaker
tts = TTS ( model_name = "coqui_studio/en/Torcull Diarmuid/coqui_studio" , progress_bar = False , gpu = False )
# Run TTS
tts . tts_to_file ( text = "This is a test." , file_path = OUTPUT_PATH )
# Run TTS with emotion and speed control
tts . tts_to_file ( text = "This is a test." , file_path = OUTPUT_PATH , emotion = "Happy" , speed = 1.5 )| ตัวอย่างสั้น ๆ | ตัวอย่างสั้น ๆ | ตัวอย่างสั้น ๆ |
Rainbow.mp4 | Windy.mp4 | ลมแรง -2.mp4 |
| Rainbow เป็นปรากฏการณ์อุตุนิยมวิทยาที่เกิดจากการสะท้อนการหักเหและการกระจายของแสง | คนขับเรียนรู้บทเรียนของเขา เขาจะไม่ขับรถอีกต่อไป | คนข้างนอกกำลังงอ ลมทำให้ยากที่จะเดิน |
| ตัวอย่างยาว | ตัวอย่างยาว | ตัวอย่างยาว |
an.apple.pie.mp4 | cat.and.a.dog.mp4 | The.farmer.mp4 |
| ต้นไม้เต็มไปด้วยแอปเปิ้ลสีแดง ชาวนากำลังขี่ม้าสีน้ำตาลของเขา เขาหยุดใต้ต้นไม้ เขาเอื้อมมือออกไปและหยิบแอปเปิ้ลออกจากสาขา เขากัดลงในแอปเปิ้ลดิบ เขาสนุกกับแอปเปิ้ล ม้าของเขาหันหัวไปมองเขา ชาวนาหยิบแอปเปิ้ลอีกตัวจากต้นไม้ เขามอบมันให้กับม้า ม้ากินแอปเปิ้ลดิบ ม้าสนุกกับแอปเปิ้ล ชาวนาใส่แอปเปิ้ลโหลลงในกระเป๋า เขาขี่ม้ากลับบ้าน เขาวางม้าไว้ในโรงนา เขาเดินเข้าไปในบ้านของเขา แมวลูบขึ้นกับขาของเขา เขาให้นมอุ่นชามแมว /td> | แมวดำกระโดดขึ้นไปบนเก้าอี้ มันมองลงไปที่สุนัขสีขาว สุนัขกำลังเคี้ยวกระดูก แมวกระโดดขึ้นไปบนสุนัข สุนัขยังคงเคี้ยวกระดูก แมวเล่นกับหางของสุนัข สุนัขยังคงเคี้ยวกระดูก แมวกระโดดกลับไปที่เก้าอี้ มันเริ่มเลียอุ้งเท้า สุนัขยืนขึ้น มันดูแมว มันเลียขนของแมว แมวเลียจมูกของสุนัข สุนัขกลับไปที่กระดูกของมัน เด็กชายวิ่งผ่านห้อง เขาสวมเสื้อเหลือง เขาเกือบจะวิ่งเข้าไปในเก้าอี้ แมวกระโดดขึ้นจากเก้าอี้ แมวกระโดดขึ้นไปบนโซฟา | ชาวนาขับรถแทรคเตอร์ รถแทรกเตอร์ขุดพื้น เขาปลูกข้าวโพดสีเหลืองในพื้นดิน เขาปลูกข้าวโพดสีเหลืองในฤดูใบไม้ผลิ ข้าวโพดเติบโตในฤดูร้อน ฝนช่วยให้ข้าวโพดเติบโต หากไม่มีฝนข้าวโพดจะตาย หากมีฝนตกมากมีข้าวโพดจำนวนมาก เขาเก็บเกี่ยวข้าวโพดสีเหลืองในช่วงปลายฤดูร้อน เขาขายข้าวโพดที่ยืนผักของเขา เขาขายหูข้างหนึ่งราคา 25 เซ็นต์ เขาขายสี่หูในราคา $ 1 เขาขายข้าวโพดทั้งหมดของเขาในเวลาเพียงหนึ่งเดือน เพื่อนบ้านรักข้าวโพดของเขา ข้าวโพดสด มันเป็นสีเหลืองสดใส มันอร่อย มันอร่อย นกก็รักข้าวโพดของเขาเช่นกัน พวกเขาไม่จ่ายเงิน พวกเขากินมันในขณะที่อยู่ในสนาม |
| การสนับสนุนหลายภาษา: ภาษาอังกฤษ | การสนับสนุนหลายภาษา: ฝรั่งเศส | การสนับสนุนหลายภาษา: ดัตช์ |
Rain.and.hail.mp4 | fr-rain.and.hail.mp4 | nl-rain.and.hail.mp4 |
| เมฆมืดอยู่บนท้องฟ้า พระอาทิตย์ตกดิน อากาศหนาวเย็น ลมเริ่มพัด ใบระเบิดออกจากต้นไม้ กระดาษบินผ่านอากาศ ผู้คนติดกระดุมแจ็คเก็ต ฝนเริ่มตก ตอนแรกมันเงียบ จากนั้นมันก็ดังขึ้น | un arcoíris o arco iris es un fenómenoóptico y meteorológico que ประกอบด้วย en la aparición en el cielo de un arco de luz หลายสี | een regenboog คือ een gekleurde cirkelboog ตาย aan de hemel waargenomen kan worden als de, laagstaande |
tts รายการที่ให้มาเป็นรุ่น:
$ tts --list_models
รับข้อมูลรุ่น (สำหรับทั้ง tts_models และ vocoder_models):
```
$ tts --model_info_by_name tts_models/tr/common-voice/glow-tts
```
```
$ tts --model_info_by_name vocoder_models/en/ljspeech/hifigan_v2
```
เรียกใช้ TTS ด้วยรุ่นเริ่มต้น:
ตัวอย่างเช่น:
$ tts --text "Text for TTS" --model_name "tts_models/en/ljspeech/glow-tts" --out_path output/path/speech.wav
เรียกใช้โมเดล TTS หลายลำโพงของคุณเอง:
$ tts --text "Text for TTS" --out_path output/path/speech.wav --model_path path/to/model.pth --config_path path/to/config.json --speakers_file_path path/to/speaker.json --speaker_idx <speaker_id>
|- notebooks/ (Jupyter Notebooks for model evaluation, parameter selection and data analysis.)
|- utils/ (common utilities.)
|- TTS
|- bin/ (folder for all the executables.)
|- train*.py (train your target model.)
|- ...
|- tts/ (text to speech models)
|- layers/ (model layer definitions)
|- models/ (model definitions)
|- utils/ (model specific utilities.)
|- speaker_encoder/ (Speaker Encoder models.)
|- (same)
|- vocoder/ (Vocoder models.)
|- (same)