From 134c7fcdf301769add63339a41c0707a2fb9dc6c Mon Sep 17 00:00:00 2001 From: "dmazzoni@chromium.org" Date: Wed, 24 Aug 2011 00:44:24 +0000 Subject: Fix a bug in the TTS extension API, in both the Mac & Windows implementations, where events from a previous utterance could be mistakenly interpreted as applying to the current utterance. The underlying bug is the same in both files, the fix is a little bit different. BUG=92514 TEST=manual testing Review URL: http://codereview.chromium.org/7686017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97960 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/extensions/extension_tts_api_win.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'chrome/browser/extensions/extension_tts_api_win.cc') diff --git a/chrome/browser/extensions/extension_tts_api_win.cc b/chrome/browser/extensions/extension_tts_api_win.cc index 7fe146f..fd7891f 100644 --- a/chrome/browser/extensions/extension_tts_api_win.cc +++ b/chrome/browser/extensions/extension_tts_api_win.cc @@ -115,13 +115,17 @@ bool ExtensionTtsPlatformImplWin::Speak( HRESULT result = speech_synthesizer_->Speak( merged_utterance.c_str(), - SPF_ASYNC | SPF_PURGEBEFORESPEAK, + SPF_ASYNC, &stream_number_); return (result == S_OK); } bool ExtensionTtsPlatformImplWin::StopSpeaking() { if (speech_synthesizer_ && !paused_) { + // Clear the stream number so that any further events relating to this + // utterance are ignored. + stream_number_ = 0; + speech_synthesizer_->Pause(); paused_ = true; } -- cgit v1.1