summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2009-06-25 17:03:51 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2009-06-25 17:10:26 -0700
commit6c24f24b3ebce9107dfe8d7f0c5507a6d9c09f58 (patch)
treef5668938c26be9ab1eaa813dc369c4c0882c8e5b /packages
parent7cb8182e36268dca8ca59d706966c43095c8baa0 (diff)
downloadframeworks_base-6c24f24b3ebce9107dfe8d7f0c5507a6d9c09f58.zip
frameworks_base-6c24f24b3ebce9107dfe8d7f0c5507a6d9c09f58.tar.gz
frameworks_base-6c24f24b3ebce9107dfe8d7f0c5507a6d9c09f58.tar.bz2
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.
Diffstat (limited to 'packages')
-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 0dafcc1..c356acb 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