Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gTTS throws unknown error for some languages, help me find why. #359

Closed
prasha230 opened this issue Jun 25, 2022 · 3 comments
Closed

gTTS throws unknown error for some languages, help me find why. #359

prasha230 opened this issue Jun 25, 2022 · 3 comments
Labels

Comments

@prasha230
Copy link

Prerequisites

Yes, I have upgraded the gTTS (currently using gTTS==2.2.4), so i don't think there is an issue with the gtts version

Current Behaviour (steps to reproduce)

for some languages like armeninan -- hy, macedonian -- mk, welsh -- cy gtts throws this error

Exception Type: | gTTSError
200 (OK) from TTS API. Probable cause: Unknown

although these languages exist in gtts.tts.tts_langs(), but it still throws this error

This is the code

lang_code = 'hy'
myobj = gTTS(text=response[0]['translations'][0]['text'], lang=lang_code, slow=False)
myobj.save('translate/static/response.mp3')

Environment

  • The project is in python django framework
  • gTTS version:2.2.4
  • Operating System version:Windows11
@PureTryOut
Copy link

These are also failing in the tests, including Esperanto (eo):

FAILED gtts/tests/test_tts.py::test_TTS[Welsh] - gtts.tts.gTTSError: 200 (OK) from TTS API. Probable cause: No audio stream in response. Unsupported language 'cy'
FAILED gtts/tests/test_tts.py::test_TTS[Esperanto] - gtts.tts.gTTSError: 200 (OK) from TTS API. Probable cause: No audio stream in response. Unsupported language 'eo'
FAILED gtts/tests/test_tts.py::test_TTS[Armenian] - gtts.tts.gTTSError: 200 (OK) from TTS API. Probable cause: No audio stream in response. Unsupported language 'hy'
FAILED gtts/tests/test_tts.py::test_TTS[Macedonian] - gtts.tts.gTTSError: 200 (OK) from TTS API. Probable cause: No audio stream in response. Unsupported language 'mk'

Seems upstream changed something?

@pndurette
Copy link
Owner

Sorry about the delay on this, yep, some languages have definitely disappeared. I will need to re-run the language generator and publish an update. Actually my goal is to make the language generator run on a schedule and automatically create a PR on language changes, since those can happen without notice.

@pndurette pndurette added the bug label Oct 5, 2022
@pndurette
Copy link
Owner

Fixed in #369! (gTTS 2.3.0)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants