Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to give pause or gap between words in TTS in android

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 ?

like image 800
SMS Avatar asked May 06 '14 11:05

SMS


People also ask

How do you pause text to speech on Android?

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.

How do you pause text to speech in Python?

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.


1 Answers

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);
like image 98
Mairyu Avatar answered Oct 13 '22 11:10

Mairyu