Android Text to Speech adds speech text continuously

I am currently developing an application for visually impaired people who will read .txt files. I’m thinking about loading texts in blocks, that is, 50 characters, which will be something like a “page”. The problem is how to connect these “blocks” in TTS. I use the method Tts.speak(speechText, TextToSpeech.QUEUE_ADD, null), and there is always a space between the blocks. This is annoying when a word or sentence (due to intonation) is divided into the space of speech. Is there something like a "stream" that allows you to constantly add speech text to tts and that does not give speech space?

I know that I can divide text not into pages, but into sentences, but not all texts in sentences, so I would need to determine a good way to divide the text. A solution with blocks with the same number of characters seems to me better.

+4
source share
1 answer

Have you tried to initialize a new TextToSpeech for every 50 characters and run it when the first ends?

Did you determine, for example, the correct initialization of two different TextToSpeech variables? and although:

1) First 50 chars added to the first queue and at the same time the second 50 chars added to the second queue; 
2) When the first queue ends to reproduce start the second one end rewrite the first one with the third 50 chars; 

I think you should not have delays. They are necessary when changing one queue, but if you start a new one, it should be immediate.

0
source

All Articles