public static void stopTts() { if (mTts != null) { if (sTextQueue != null) { sTextQueue.clear(); } mTts.stop(); } } }
public static void releaseTts() { if (mTts != null) { mTts.stop(); mTts.shutdown(); } }
@Test public void isStopped_shouldReturnTrueAfterStop() throws Exception { textToSpeech.stop(); assertThat(shadowOf(textToSpeech).isStopped()).isTrue(); }
public void stop() { if (mTextToSpeech != null) { if (mTextToSpeech.isSpeaking()) { mTextToSpeech.stop(); } mTextToSpeech.shutdown(); } if (mediaPlayer != null && mediaPlayer.isPlaying()) { mediaPlayer.stop(); mediaPlayer.release(); mediaPlayer = null; mediaHandler.removeCallbacks(mHighlightTask); } } }
public void stateChanged(MediaOverlayPlayPauseEvent event) { if (event.isStateChanged()) { if (mediaPlayer != null) { mediaPlayer.pause(); } if (mTextToSpeech != null && mTextToSpeech.isSpeaking()) { mTextToSpeech.stop(); } } else { if (event.isPlay()) { UiUtil.keepScreenAwake(true, context); } else { UiUtil.keepScreenAwake(false, context); } if (mediaType == MediaType.SMIL) { playSMIL(); } else { if (mTextToSpeech.isSpeaking()) { mTextToSpeech.stop(); mIsSpeaking = false; callbacks.resetCurrentIndex(); } else { mIsSpeaking = true; callbacks.highLightTTS(); } } } }
public void onDestroy() { if (mTts != null) { mTts.stop(); mTts.shutdown();
@Override public void run() { tts.stop(); } };
/** * Stops text to speech. */ public void stopTextToSpeech() { if (mTextToSpeech != null) { mTextToSpeech.stop(); } }
mTts.stop(); mTts.shutdown();
public void destory() { if (mTTS != null) { mTTS.stop(); mTTS.shutdown(); mTTS = null; } } }
public void pause() { isPaused = true; Log.d(TAG, "TTS Paused at " + currentQueueIndex); if (tts != null && tts.isSpeaking()) { tts.stop(); } }
public void dispose() { if (tts != null) { tts.stop(); tts.shutdown(); } }
@Override public void onDestroy() { // Don't forget to shutdown! if (mTts != null) { mTts.stop(); mTts.shutdown(); } super.onDestroy(); }
@Override public void onDestroy() { if (tts != null) { tts.stop(); tts.shutdown(); } super.onDestroy(); }
@Override protected void onDestroy() { super.onDestroy(); textToSpeech.stop(); textToSpeech.shutdown(); } }
/** * Make sure to clean up the tts engine when being destroyed */ @Override public void onDestroy() { if (mTts != null) { mTts.stop(); mTts.shutdown(); } super.onDestroy(); }
@Override public void onDestroy() { // Don't forget to shutdown! if (mTts != null) { mTts.stop(); mTts.shutdown(); } super.onDestroy(); }
@Override public void onPause() { if (tts != null) { tts.stop(); tts.shutdown(); } super.onPause(); }
@Override public void onShake() { Log.i(TAG, "TTS silenced by shake"); synchronized (ttsQueue) { for (NotificationInfo info : ttsQueue.values()) { info.addIgnoreReason(IgnoreReason.SHAKE); } } if (mTts != null) mTts.stop(); NotifyList.refresh(); } });
@Override public void run() { ttsToShutdown.setOnUtteranceCompletedListener(null); ttsToShutdown.stop(); ttsToShutdown.shutdown(); } }.start();