I have given a text in mytts.speak("hi hello hi",parameter,parameter...);
But the words are continuously said without any gap or pause, I want to provide some time gap between words for more clarity.
How could I achieve this ?
There isn't a pause event or method, so you can not pause and resume. Unfortunately, the way the Android TTS interface is designed makes it next to impossible to implement a pause/resume feature, at least not without a lot of extra bookkeeping. The two main APIs it provides are a speak() call and a stop() call.
Simply adjust your SythesisInput(synthesis_input = texttospeech. SynthesisInput(ssml=ssml_text)) object passed into the TTS client and wrap your text with <speak>.... </speak>. Use the SSML tags as shown in documentation.
If I understand your question correctly, this thread has the answer (by rushi).
Simply add a delay into the TTS queue by splitting the string and loop over the snippets via a for loop:
mytts.speak(snippet, QUEUE_ADD, null);
mytts.playSilentUtterance(2000, QUEUE_ADD, null);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With