summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Android (Google) Code Review <android-gerrit@google.com> 2009-06-25 17:37:43 -0700
committer The Android Open Source Project <initial-contribution@android.com> 2009-06-25 17:37:43 -0700
commit6d65c2304bfda221f1dafc4d7342720df86f104d (patch)
treeb491243655e5f1450396469df4e0746038d240d2
parent693d50e7aef79f16519bf9786af68124ffaf5cd8 (diff)
parentee513b600efeb55040030a3dc9c8e7ef74b36149 (diff)
am ee513b60: Merge change 5444 into donut
Merge commit 'ee513b600efeb55040030a3dc9c8e7ef74b36149' * commit 'ee513b600efeb55040030a3dc9c8e7ef74b36149': In the native layer for the TTS service, delete the data allocated for the callback after the signal for the end of the synthesis has been received.
-rw-r--r--packages/TtsService/jni/android_tts_SynthProxy.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/packages/TtsService/jni/android_tts_SynthProxy.cpp b/packages/TtsService/jni/android_tts_SynthProxy.cpp
index 0dafcc1354dd..c356acb50683 100644
--- a/packages/TtsService/jni/android_tts_SynthProxy.cpp
+++ b/packages/TtsService/jni/android_tts_SynthProxy.cpp
@@ -204,11 +204,19 @@ static tts_callback_status ttsSynthDoneCB(void *& userdata, uint32_t rate,
fwrite(wav, 1, bufferSize, pForAfter->outputFile);
}
}
- // TODO update to call back into the SynthProxy class through the
+ // Future update:
+ // For sync points in the speech, call back into the SynthProxy class through the
// javaTTSFields.synthProxyMethodPost methode to notify
- // playback has completed if the synthesis is done, i.e.
- // if status == TTS_SYNTH_DONE
- //delete pForAfter;
+ // playback has completed if the synthesis is done or if a marker has been reached.
+
+ if (status == TTS_SYNTH_DONE) {
+ // this struct was allocated in the original android_tts_SynthProxy_speak call,
+ // all processing matching this call is now done.
+ LOGV("Speech synthesis done.");
+ delete pForAfter;
+ pForAfter = NULL;
+ return TTS_CALLBACK_HALT;
+ }
// we don't update the wav (output) parameter as we'll let the next callback
// write at the same location, we've consumed the data already, but we need