-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Max Length for Text to read in some voices? #227
Comments
Hi @stereonom thanks for reporting. I assume you used Chrome? Which OS did you use?
Let me investigate this |
@jankapunkt yeah, I'm using Chrome – on MacOS. It's not a bug that only happens in the current versions. I'm seeing this since I started using easy-speech. (~July 2023) I tested some other text and the maximum seems to vary a bit. My other test text worked with 4005 characters but failed with 4006. 🤷🏼♂️ |
@stereonom can you please paste/analyze the other texts with the code below? I have a strong assumption that the text exceeds const text = '...' // the text from above
console.debug((new TextEncoder().encode(text)).length) // 4097 In JavaScript not every character is the same size: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_code_points_and_grapheme_clusters I therefore assume, that all Google Voices have an upper limit of If this is the case we can at least throw an error message if
I would like to avoid for now to automatically split the text and read the chunks as this will lead to multiple start/end events being fired. I'd rather leave this to the user as they might know much better where to split, how long the pause between the chunks etc. is best. What do you think? |
Yeah, u are right. My other text is 4.097 bytes long. 🤪 I understand that you will not include the auto-splitting because of the events. |
@stereonom would you mind reviewing (using the GitHub review functionality) this pull request: #229 |
I recognized that (even in your demo), that the Google Voices (e.g. Google UK English Male) can't read very long text.
When I truncate my text to 4053 charactes it works. With 4054 it doesn't.
Here's the text: (4054 characters long. To make it work, just remove one character)
Is this a known thing?
It there any variable I can check to get this max length?
The text was updated successfully, but these errors were encountered: