-
Notifications
You must be signed in to change notification settings - Fork 361
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
Error if text > 200 char #252
Comments
@antoniofagardo Thanks for the report, let me take a look. |
Yeah, there's a weird bug with how requests are prepared I think. It sends way too much data to the API. Investigating more. |
Ah found it— So the error was indeed that the API was getting too many characters (I guess it's 200 now!) and not returning any audio. Which was an error that Fixing and will push a new version. |
Pushed |
Thank you for the quick fix! |
Ive got the same problem, but i think due to a different reason Traceback (most recent call last): Is there any fix? I have installed gTTS 2.2.1. |
Mesmo problema aqui |
I found the problem in my case, the translation accent was set to "en-ca" representing english canadian. After some debugging (sweat over my body, tears dropping down my head, axillary region all wet etc. :-)) I found it. Maybe you should check what happens if you change the speaking accent to English with "en", I also removed slow=False. Check it out and let me know if it works out. |
Unbelievable, the code below was working like a charm for two months now (gTTs 2.2.1). Started to get the error commented here. Tried KelvinKramp approach and it is working again. I mean the error stopped but lang="en" and lang="en-au" produces a different result right? def text_to_speech(): |
@KelvinKramp and @srugai Hi there, you're right, Google has removed upstream almost of the I've removed them, see #267, but since they've been part of the library for years, I'm adding a compatibility fallback (eg "en-CA" falls back to "en"). |
What to do if we actually want the accents... |
I was having the same issue. My code was:
I changed es-us to es and it worked |
Since zh is not a language, Chinese does not work at all. from gtts import gTTS Get "gtts.tts.gTTSError: 200 (OK) from TTS API. Probable cause: Unknown" on both tts.save() |
I am having the same issue with erichsu0527. Are there any workarounds? |
Same problem here as @zesto01 and @erichsu0527. Input:
Trace:
|
@erichsu0527, @zesto01, @joeminicucci I was able to run all of your code samples without any issues. Have you updated? There was an upstream change with languages, which was fixed in |
@KelvinKramp, @srugai & @NikithaNimbalkar: The accents are back, just obtained differently! I've added updated documentation on how to obtain local accents with the combination of the right language code ( |
@pndurette I tested that code 5 days ago on 2.2.2. Let me try again. |
@pndurette Following the new tld convention (doesn't apply since Im using zh-CN and zh-TW only), Im still reliably reproducing the error. |
@joeminicucci Ah damn, let's look. Do you mind opening a new issue with your problem? It's really getting difficult to follow exactly the issues everyone is experiencing as the current GitHub issue has gone all over the place. |
@joeminicucci @pndurette |
@pndurette |
I am currently running version
2.2.0
and it seems like if the text we are trying to convert is greater than 200 char, the conversion fails with the following message:Sample code to reproduce the problem:
if you change back
finalChar
to200
, the request works and the file is written on disk.The text was updated successfully, but these errors were encountered: