drmfinlay / tts-util-app

TTS Util — Text-to-speech utility Android app for synthesising text into audible speech

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Character limit + text highlighting

strikerlulu opened this issue · comments

It shows "There was an error during speech synthesis" toast message..... Does it have limit for characters ? which we can paste and [speak text]

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
I was using Google TTS
and the language was Malayalam (India)

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]
But the same text is not working on [Read text] and [Read from clipboard] i think its something related to the edit text or something else....

test
Is is hard to implement functionality like this ?
(Highlighting current text which is synthesizing)

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.

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