Python Text to Speech With Different Languages (Simple)

preview_player
Показать описание
Python Text to Speech With Different Languages (Simple)

Greetings in this tutorial we shall be looking at how to do text to speech (tts) using Python. This tutorial will focus on how to speak different languages and how to change the speed of the speech. For example, we could use a slow speaking Spanish voice to help us learn how something could be pronounced in Spanish.

We will be telling our Python GTTS program to speak what we have stored in a string. We will then save the result to an audio file. I picked .wav but you can do .mp3. We can then open our audio file and listen to the python gtts say what we wanted.

You will need to import from gtts import gTTS.

This tutorial requires the GTTS library. It is super simple to install but how you do so may vary depending on what your setup is. In Visual Studio you can manager your packages in the IDE. Otherwise you can use a pip install gTTS command. You may have to do -m pip install gTTS.

Thanks for watching this Python tutorial on how to do text to speech in a quick and simple way.

Python Text to Speech With Different Languages (Simple)
Рекомендации по теме
Комментарии
Автор

Hello Max, i don't know much about programming and stuff, but is there any way to import like a docx of pdf file and make python to translate it in different langueges? And if so, could you make a tutorial of it? (ps was looking for software or online text to speech, but most of em costs alot of money or they have word limits)

hzkaciarasyt
Автор

Hello Max,
Please List the languages available in GTTS.

EEswar-lige