tts = gTTS("Hello", lang='en', tld='co.uk')
List available voices: edge-tts --list-voices
However, this is where the magic happens. To , you actually change the accent and locale . Different locales use different neural network models, which produce distinctly different vocal characteristics (pitch, timbre, and cadence). gtts change voice
Since gTTS outputs standard MP3 files, you can use third-party libraries like pydub to manually manipulate the or speed after the audio is saved. Increasing the pitch can make the default voice sound more feminine, while lowering it can give it a more masculine tone. Alternatives for More Control
It helps to understand where gTTS stands compared to alternatives: tts = gTTS("Hello", lang='en', tld='co
While this changes the accent and intonation, it is important to note that for English, these are predominantly .
In some versions of the library (like 2.2.2), developers reported a "random voice" bug where the system would seemingly pick between male and female voices at random for certain languages like Spanish. This further highlights the library's lack of manual control—you often get what Google decides to serve at that moment. Summary of How to "Change" the Voice Since gTTS outputs standard MP3 files, you can
tts_ca = gTTS(text="Hello, welcome to the future of audio.", lang='en', tld='ca') tts_ca.save("canadian_voice.mp3")
tts_au = gTTS(text=text, lang='en', tld='com.au') tts_au.save("voice_au.mp3")
The answer is complicated. Google Translate's public API assigns voices based on the language. Many languages default to a female voice, but some languages utilize a male voice profile.
The real power of being able to on the fly is creating audio narratives with multiple characters. Since gTTS cannot change voice mid-stream, you generate separate MP3 files and concatenate them.