public static void releaseTts() { if (mTts != null) { mTts.stop(); mTts.shutdown(); } }
@Test public void isShutdown_shouldReturnTrueAfterShutdown() throws Exception { textToSpeech.shutdown(); assertThat(shadowOf(textToSpeech).isShutdown()).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); } } }
if (mTts != null) { mTts.stop(); mTts.shutdown();
@Override protected void onDestroy() { super.onDestroy(); // Libera os recursos da engine do TTS tts.shutdown(); } }
@Override public void onInterrupt() { Toast.makeText(this, "服务已中断", Toast.LENGTH_SHORT).show(); mTts.shutdown(); }
public static synchronized void shutdown() { if (tts != null) { try { tts.shutdown(); } catch (IllegalArgumentException e) { UserError.Log.e(TAG, "Got exception shutting down service: " + e); } tts = null; } }
public void destory() { if (mTTS != null) { mTTS.stop(); mTTS.shutdown(); mTTS = null; } } }
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() { super.onDestroy(); unregisterReceiver(awareTTS); if( tts != null ) tts.shutdown(); }
@Override protected void onDestroy() { super.onDestroy(); textToSpeech.stop(); textToSpeech.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 public void onDestroy() { if (mTts != null) { mTts.shutdown(); mTts = null; } super.onDestroy(); }
public static synchronized void shutdown() { if (tts != null) { try { tts.shutdown(); } catch (IllegalArgumentException e) { UserError.Log.e(TAG, "Got exception shutting down service: " + e); } tts = null; } }
@Override public void onDestroy() { if (mTts != null) mTts.shutdown(); super.onDestroy(); }
/** * 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 run() { ttsToShutdown.setOnUtteranceCompletedListener(null); ttsToShutdown.stop(); ttsToShutdown.shutdown(); } }.start();