-
Notifications
You must be signed in to change notification settings - Fork 19
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
Character limit + text highlighting #1
Comments
I haven't noticed any character limits in the app. If there are any limits, they certainly weren't intentional on my part. Is the message only occurring for a large amount of text? Could you please let me know what Android version you're using and which text-to-speech engine is selected in the settings (e.g. Pico TTS). |
Android 10 |
Thanks 👍. I will do some testing and see if I can reproduce and fix the problem. Incidentally, let me know if the clipboard-related features don't work properly in Android 10. Google added some privacy features for clipboard access which I couldn't find much documentation on at the time. |
Its working when i paste the text in a file and try to use [read from file] |
Thanks. I agree that it sounds like a problem with the edit text fields. It should be possible to highlight the current text being synthesized within the text fields, but only with the current chunk of text being read. It would highlight paragraphs at a time, rather than individual words. I could add a setting for queuing words as single utterances, but this might change how the text-to-speech engine pronounces the input. I'd have to do some testing and get back to you on that. |
Ok thanks,also a continue button would be nice...so instead of starting it from the begging it could continue where it stopped... |
That's a good idea. There should probably be separate buttons for stopping, pausing and resuming. I'll see if I can add those in. It would also be nice if the notification allowed for finer control like this. As a side note, mostly for future me, the text field should be locked/disabled during text-to-speech output or if audio output has been paused because it doesn't make sense to edit while speech is occurring, especially if we're highlighting the text as we go. BTW these new features should really be in separate issues. I'll try to open some new ones soon :) |
@strikerlulu Don't worry about my technobabble below, just making a few notes on this feature while I think of it :) If an utterance was in progress when paused, then it has to be repeated once speech output is resumed because, unfortunately, Android's text-to-speech API does not give us the level of fine-grained control needed to pick up again in the middle of an utterance. However, we can get around this by synthesising input text as a wave file internally and then playing it, keeping track of the playback position like music apps must do. This also avoids splitting up the input into one utterance per word. Hopefully this approach doesn't mean there will be more of a delay before speech output starts. If it does create a noticeable delay, then we can try to sensibly split input text into smaller chunks and synthesize those into wave files one at a time. We could also just have one of those spinning progress things while the text is processed, that might be simpler. |
Re: #1. Long lines like this are now split into multiple smaller lines of reasonable length before they are passed to the TTS engine. This has not been implemented for Speaker.synthesizeToFile() yet.
Closes #1. This works around Android's maximum speech input length for TTS file synthesis. Long text files are now split up, synthesised into smaller wave files and then joined back together as one larger wave file after all parts are synthesised successfully.
@strikerlulu I thought I would let you know that the input limit you discovered with TTSUtil will be fixed in the next release for both text-to-speech output and wave file synthesis. Regarding the highlighting, skip backward/forward and play/pause functionality, I don't think I will be able to implement that. It would be quite involved and I am hesitant to add new features. You could use the app to create wave files to do the playback control part in a separate media player app. If it helps, Firefox's Reader View has text-to-speech with highlighting as text is read. I imagine Chrome has something similar. There are probably other solutions out there too. |
I'm reopening this issue for the text highlighting part, @strikerlulu. I think that can be implemented in a future version. However, it will only work in the application's own text input fields. |
This will be used by the UI code to highlight currently spoken text, as discussed in issue #1. The TaskProgressObserver interface has been renamed to TaskObserver.
It shows "There was an error during speech synthesis" toast message..... Does it have limit for characters ? which we can paste and [speak text]
The text was updated successfully, but these errors were encountered: