destr
destr

Reputation: 3

Android tts flush

Please don't advise to use tts.stop() to flush text from tts queue.

I want to ask suppose if I have

HashMap<String, String> params = new HashMap<String, String>();
params.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID,"tag2");
tts.speak("Hi",TextToSpeech.QUEUE_ADD,params);
tts.speak("Hello",TextToSpeech.QUEUE_ADD,params);

And similarly there are a bunch of other sentences added to the queue.

My question is what will be the action if

tts.speak("Flushing",TextToSpeech.QUEUE_FLUSH,null); is done

OR

tts.speak("Flushing",TextToSpeech.QUEUE_FLUSH,params); is done

where params is the same as the earlier one

Is the action different in both the cases, i.e do the sentences get flushed only when the params parameter or the utterance id is the same for them?

Thanks!

Upvotes: 0

Views: 2338

Answers (1)

Hoan Nguyen
Hoan Nguyen

Reputation: 18151

There is no difference, all your application queue will be flushed. The HashMap param is to pass extra info for the speech engine. In your case, if passing null onUtteranceCompleted would not be called. See document http://developer.android.com/reference/android/speech/tts/TextToSpeech.html#QUEUE_FLUSH

Upvotes: 1

Related Questions