com tld and en lang is like co.uk voice
Prerequisites
- [yes] Did you make sure a similar issue didn't exist?
- [yes] Did you update gTTS to the latest? (
pip install --upgrade gTTS)
ooliver@tooty:~/projects/tooty$ python3.8 -m pip install -U gTTS
Requirement already up-to-date: gTTS in /home/ooliver/.local/lib/python3.8/site-packages (2.2.3)
Requirement already satisfied, skipping upgrade: requests in /usr/lib/python3/dist-packages (from gTTS) (2.22.0)
Requirement already satisfied, skipping upgrade: six in /usr/lib/python3/dist-packages (from gTTS) (1.14.0)
Requirement already satisfied, skipping upgrade: click in /home/ooliver/.local/lib/python3.8/site-packages (from gTTS) (8.0.1)
ooliver@tooty:~/projects/tooty$
Current Behaviour (steps to reproduce)
british accent not american
speech = gTTS(text=text, slow=False, lang="en", tld="com")
Expected Behaviour
american accent
Context
I would like to use the american accent too
Environment
- gTTS version: 2.2.3
- Operating System version: Ubuntu 20.04.2 LTS
Same on arch linux. With tld set to "com" or "en" the output is British English. However tld="us" makes it output US English. This can be used as a workaround until it fixed.
gTTS version: 2.2.3 Python 3.9.7
us works yep, maybe edit docs for that
it was also a very random change
tld isn't working at the moment, see https://github.com/pndurette/gTTS/issues/363 and https://github.com/pndurette/gTTS/issues/382
@PanderMusubi This is unrelated—
The situation here is that when reaching google.com it will redirect you to the one relative to your geographical location. So the English will sound closer to the English in your locale (according to Google).
It's hard for me to test as I'm in North America, however I think here the solution is that tld="us" (as shared by @DartHeilagr above) can give US English, notwithstanding where the code is run.
The best I can do is document the behaviour.