gTTS icon indicating copy to clipboard operation
gTTS copied to clipboard

com tld and en lang is like co.uk voice

Open ooliver1 opened this issue 4 years ago • 3 comments

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

ooliver1 avatar Aug 26 '21 12:08 ooliver1

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

spareleg avatar Nov 02 '21 11:11 spareleg

us works yep, maybe edit docs for that

ooliver1 avatar Nov 08 '21 14:11 ooliver1

it was also a very random change

ooliver1 avatar Nov 25 '21 13:11 ooliver1

tld isn't working at the moment, see https://github.com/pndurette/gTTS/issues/363 and https://github.com/pndurette/gTTS/issues/382

PanderMusubi avatar Jan 12 '23 14:01 PanderMusubi

@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.

pndurette avatar Jan 13 '23 05:01 pndurette