read-aloud icon indicating copy to clipboard operation
read-aloud copied to clipboard

Is there a way to make the extention prepare the next phrase when the current one is being read? (android system TTS)

Open tuxayo opened this issue 6 months ago • 1 comments

On Firefox Android.

On my mid range 2019 phone, I'm using SherpaTTS as a system TTS with alba-medium voice. It needs some time to start reading, 2 to 3 seconds, it's just too CPU intensive for a bit old phones I think. The voice is decent but not great. I could use better voices but the start time would be like 5 seconds.

From what I see, it seems Read Aloud is querying the TTS only when the phrase/section ends. So it constantly makes big pauses. Is there a way to have it query the system TTS in the background to have the next phrase already "rendered" and just play the audio immediately when needed?

I depends on if the TTS api allows to get like an audio file. If the API only allows to say "read now this" then i'm not sure something that would help is possible.

tuxayo avatar Jun 18 '25 05:06 tuxayo

Not just for local TTS, I run into similar problem of sizable pauses between "chunks" of text using cloud voices. In my case, google cloud's TTS (chrip3)

mlesmana avatar Jul 10 '25 01:07 mlesmana

Unfortunately the TTS API that the system exposes to applications does not support prefetch. There's only the speak() function, which tells the engine to start speaking immediately. When this API was created many years ago, they didn't expect to have to AI models running on devices and requiring a lot of CPUs, and taking many seconds to synthesize speech. Early TTS engines use technology that could synthesize speech in milliseconds, and so was never a problem.

So, any prefetching has to be supported in the code itself. We do prefetching for most of the cloud voices that are supported directly in the extension. Edit: just checked the code and we do prefetching for the GoogleWavenet voices, so not sure why @mlesmana is running into that issue. Are you using Chrome/Edge or Firefox?

ken107 avatar Dec 11 '25 15:12 ken107