Note that there are some explanatory texts on larger screens.

plurals
  1. POonUtteranceCompleted gets fired on emulator, but not on hardware
    primarykey
    data
    text
    <p>I can't get my onUtteranceCompleted() get fired on my Galaxy Nexus 4.0.2. My emulators with api 8, 10 and 15 do fire onUtteranceCompleted(). I've invested about 5 hours and read every single post on stackoverflow about this and I don't get it to work. I would be so happy if someone can help me out ;( I'm pretty new to android, so it would be awesome if you could explain it for beginners. </p> <p>edit: well.. the statement above is true for most cases, I just got it to work on my Hardware 4.0.2. Then I closed it and started it again, and onUtteranceCompleted() did <strong>not</strong> get fired again. Had the same thing yesterday (before some code changes), so its not working 90% of the time. Can't figure it out ;(</p> <p>edit2:FYI: the mTts.setOnUtteranceCompletedListener(this); returns TextToSpeech.SUCCESS</p> <p>Thanks a lot!</p> <p>Here is my code:</p> <pre><code>(...) public void onInit(int status) { mTts.setOnUtteranceCompletedListener(this); if (status == TextToSpeech.SUCCESS) { int result = mTts.setLanguage(Locale.US); if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) { Log.e(TAG, "Language is not available."); } else { TTSAusgabe.setEnabled(true); } } else { Log.e(TAG, "TTS failed"); } } SayText() { (....) MundAnimation.start(); HashMap&lt;String, String&gt; params = new HashMap&lt;String, String&gt;(); params.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, "utterance"); mTts.speak("Ma Text", TextToSpeech.QUEUE_FLUSH, params); } } // That's the bad boy! public void onUtteranceCompleted(String utterance) { MundAnimation.stop(); //startVoiceRecognitionActivity(); System.out.println("drin"); } (...) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload