Loading api/current.txt +9 −1 Original line number Diff line number Diff line Loading @@ -18890,7 +18890,8 @@ package android.speech.tts { method public int playSilence(long, int, java.util.HashMap<java.lang.String, java.lang.String>); method public deprecated int setEngineByPackageName(java.lang.String); method public int setLanguage(java.util.Locale); method public int setOnUtteranceCompletedListener(android.speech.tts.TextToSpeech.OnUtteranceCompletedListener); method public deprecated int setOnUtteranceCompletedListener(android.speech.tts.TextToSpeech.OnUtteranceCompletedListener); method public int setOnUtteranceProgressListener(android.speech.tts.UtteranceProgressListener); method public int setPitch(float); method public int setSpeechRate(float); method public void shutdown(); Loading Loading @@ -18963,6 +18964,13 @@ package android.speech.tts { method protected abstract void onSynthesizeText(android.speech.tts.SynthesisRequest, android.speech.tts.SynthesisCallback); } public abstract class UtteranceProgressListener { ctor public UtteranceProgressListener(); method public abstract void onDone(java.lang.String); method public abstract void onError(java.lang.String); method public abstract void onStart(java.lang.String); } } package android.telephony { core/java/android/speech/tts/AudioMessageParams.java +2 −2 Original line number Diff line number Diff line Loading @@ -15,12 +15,12 @@ */ package android.speech.tts; import android.speech.tts.TextToSpeechService.UtteranceCompletedDispatcher; import android.speech.tts.TextToSpeechService.UtteranceProgressDispatcher; class AudioMessageParams extends MessageParams { private final BlockingMediaPlayer mPlayer; AudioMessageParams(UtteranceCompletedDispatcher dispatcher, AudioMessageParams(UtteranceProgressDispatcher dispatcher, String callingApp, BlockingMediaPlayer player) { super(dispatcher, callingApp); mPlayer = player; Loading core/java/android/speech/tts/AudioPlaybackHandler.java +7 −3 Original line number Diff line number Diff line Loading @@ -312,10 +312,11 @@ class AudioPlaybackHandler { private void handleSilence(MessageParams msg) { if (DBG) Log.d(TAG, "handleSilence()"); SilenceMessageParams params = (SilenceMessageParams) msg; params.getDispatcher().dispatchOnStart(); if (params.getSilenceDurationMs() > 0) { params.getConditionVariable().block(params.getSilenceDurationMs()); } params.getDispatcher().dispatchUtteranceCompleted(); params.getDispatcher().dispatchOnDone(); if (DBG) Log.d(TAG, "handleSilence() done."); } Loading @@ -323,11 +324,12 @@ class AudioPlaybackHandler { private void handleAudio(MessageParams msg) { if (DBG) Log.d(TAG, "handleAudio()"); AudioMessageParams params = (AudioMessageParams) msg; params.getDispatcher().dispatchOnStart(); // Note that the BlockingMediaPlayer spawns a separate thread. // // TODO: This can be avoided. params.getPlayer().startAndWait(); params.getDispatcher().dispatchUtteranceCompleted(); params.getDispatcher().dispatchOnDone(); if (DBG) Log.d(TAG, "handleAudio() done."); } Loading Loading @@ -361,6 +363,7 @@ class AudioPlaybackHandler { if (DBG) Log.d(TAG, "Created audio track [" + audioTrack.hashCode() + "]"); param.setAudioTrack(audioTrack); msg.getDispatcher().dispatchOnStart(); } // More data available to be flushed to the audio track. Loading Loading @@ -411,6 +414,7 @@ class AudioPlaybackHandler { final AudioTrack audioTrack = params.getAudioTrack(); if (audioTrack == null) { params.getDispatcher().dispatchOnError(); return; } Loading Loading @@ -439,7 +443,7 @@ class AudioPlaybackHandler { audioTrack.release(); params.setAudioTrack(null); } params.getDispatcher().dispatchUtteranceCompleted(); params.getDispatcher().dispatchOnDone(); mLastSynthesisRequest = null; params.mLogger.onWriteData(); } Loading core/java/android/speech/tts/ITextToSpeechCallback.aidl +3 −1 Original line number Diff line number Diff line Loading @@ -21,5 +21,7 @@ package android.speech.tts; * {@hide} */ oneway interface ITextToSpeechCallback { void utteranceCompleted(String utteranceId); void onStart(String utteranceId); void onDone(String utteranceId); void onError(String utteranceId); } core/java/android/speech/tts/MessageParams.java +4 −4 Original line number Diff line number Diff line Loading @@ -15,22 +15,22 @@ */ package android.speech.tts; import android.speech.tts.TextToSpeechService.UtteranceCompletedDispatcher; import android.speech.tts.TextToSpeechService.UtteranceProgressDispatcher; abstract class MessageParams { static final int TYPE_SYNTHESIS = 1; static final int TYPE_AUDIO = 2; static final int TYPE_SILENCE = 3; private final UtteranceCompletedDispatcher mDispatcher; private final UtteranceProgressDispatcher mDispatcher; private final String mCallingApp; MessageParams(UtteranceCompletedDispatcher dispatcher, String callingApp) { MessageParams(UtteranceProgressDispatcher dispatcher, String callingApp) { mDispatcher = dispatcher; mCallingApp = callingApp; } UtteranceCompletedDispatcher getDispatcher() { UtteranceProgressDispatcher getDispatcher() { return mDispatcher; } Loading Loading
api/current.txt +9 −1 Original line number Diff line number Diff line Loading @@ -18890,7 +18890,8 @@ package android.speech.tts { method public int playSilence(long, int, java.util.HashMap<java.lang.String, java.lang.String>); method public deprecated int setEngineByPackageName(java.lang.String); method public int setLanguage(java.util.Locale); method public int setOnUtteranceCompletedListener(android.speech.tts.TextToSpeech.OnUtteranceCompletedListener); method public deprecated int setOnUtteranceCompletedListener(android.speech.tts.TextToSpeech.OnUtteranceCompletedListener); method public int setOnUtteranceProgressListener(android.speech.tts.UtteranceProgressListener); method public int setPitch(float); method public int setSpeechRate(float); method public void shutdown(); Loading Loading @@ -18963,6 +18964,13 @@ package android.speech.tts { method protected abstract void onSynthesizeText(android.speech.tts.SynthesisRequest, android.speech.tts.SynthesisCallback); } public abstract class UtteranceProgressListener { ctor public UtteranceProgressListener(); method public abstract void onDone(java.lang.String); method public abstract void onError(java.lang.String); method public abstract void onStart(java.lang.String); } } package android.telephony {
core/java/android/speech/tts/AudioMessageParams.java +2 −2 Original line number Diff line number Diff line Loading @@ -15,12 +15,12 @@ */ package android.speech.tts; import android.speech.tts.TextToSpeechService.UtteranceCompletedDispatcher; import android.speech.tts.TextToSpeechService.UtteranceProgressDispatcher; class AudioMessageParams extends MessageParams { private final BlockingMediaPlayer mPlayer; AudioMessageParams(UtteranceCompletedDispatcher dispatcher, AudioMessageParams(UtteranceProgressDispatcher dispatcher, String callingApp, BlockingMediaPlayer player) { super(dispatcher, callingApp); mPlayer = player; Loading
core/java/android/speech/tts/AudioPlaybackHandler.java +7 −3 Original line number Diff line number Diff line Loading @@ -312,10 +312,11 @@ class AudioPlaybackHandler { private void handleSilence(MessageParams msg) { if (DBG) Log.d(TAG, "handleSilence()"); SilenceMessageParams params = (SilenceMessageParams) msg; params.getDispatcher().dispatchOnStart(); if (params.getSilenceDurationMs() > 0) { params.getConditionVariable().block(params.getSilenceDurationMs()); } params.getDispatcher().dispatchUtteranceCompleted(); params.getDispatcher().dispatchOnDone(); if (DBG) Log.d(TAG, "handleSilence() done."); } Loading @@ -323,11 +324,12 @@ class AudioPlaybackHandler { private void handleAudio(MessageParams msg) { if (DBG) Log.d(TAG, "handleAudio()"); AudioMessageParams params = (AudioMessageParams) msg; params.getDispatcher().dispatchOnStart(); // Note that the BlockingMediaPlayer spawns a separate thread. // // TODO: This can be avoided. params.getPlayer().startAndWait(); params.getDispatcher().dispatchUtteranceCompleted(); params.getDispatcher().dispatchOnDone(); if (DBG) Log.d(TAG, "handleAudio() done."); } Loading Loading @@ -361,6 +363,7 @@ class AudioPlaybackHandler { if (DBG) Log.d(TAG, "Created audio track [" + audioTrack.hashCode() + "]"); param.setAudioTrack(audioTrack); msg.getDispatcher().dispatchOnStart(); } // More data available to be flushed to the audio track. Loading Loading @@ -411,6 +414,7 @@ class AudioPlaybackHandler { final AudioTrack audioTrack = params.getAudioTrack(); if (audioTrack == null) { params.getDispatcher().dispatchOnError(); return; } Loading Loading @@ -439,7 +443,7 @@ class AudioPlaybackHandler { audioTrack.release(); params.setAudioTrack(null); } params.getDispatcher().dispatchUtteranceCompleted(); params.getDispatcher().dispatchOnDone(); mLastSynthesisRequest = null; params.mLogger.onWriteData(); } Loading
core/java/android/speech/tts/ITextToSpeechCallback.aidl +3 −1 Original line number Diff line number Diff line Loading @@ -21,5 +21,7 @@ package android.speech.tts; * {@hide} */ oneway interface ITextToSpeechCallback { void utteranceCompleted(String utteranceId); void onStart(String utteranceId); void onDone(String utteranceId); void onError(String utteranceId); }
core/java/android/speech/tts/MessageParams.java +4 −4 Original line number Diff line number Diff line Loading @@ -15,22 +15,22 @@ */ package android.speech.tts; import android.speech.tts.TextToSpeechService.UtteranceCompletedDispatcher; import android.speech.tts.TextToSpeechService.UtteranceProgressDispatcher; abstract class MessageParams { static final int TYPE_SYNTHESIS = 1; static final int TYPE_AUDIO = 2; static final int TYPE_SILENCE = 3; private final UtteranceCompletedDispatcher mDispatcher; private final UtteranceProgressDispatcher mDispatcher; private final String mCallingApp; MessageParams(UtteranceCompletedDispatcher dispatcher, String callingApp) { MessageParams(UtteranceProgressDispatcher dispatcher, String callingApp) { mDispatcher = dispatcher; mCallingApp = callingApp; } UtteranceCompletedDispatcher getDispatcher() { UtteranceProgressDispatcher getDispatcher() { return mDispatcher; } Loading