diff options
author | dmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-24 00:44:24 +0000 |
---|---|---|
committer | dmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-24 00:44:24 +0000 |
commit | 134c7fcdf301769add63339a41c0707a2fb9dc6c (patch) | |
tree | ba968a21c43fe73e65e7a4187c88b338f43f548e /chrome/browser/extensions/extension_tts_api_win.cc | |
parent | 0c2ef0bb6baff17c561852368a7c7eeee8369798 (diff) | |
download | chromium_src-134c7fcdf301769add63339a41c0707a2fb9dc6c.zip chromium_src-134c7fcdf301769add63339a41c0707a2fb9dc6c.tar.gz chromium_src-134c7fcdf301769add63339a41c0707a2fb9dc6c.tar.bz2 |
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
Diffstat (limited to 'chrome/browser/extensions/extension_tts_api_win.cc')
-rw-r--r-- | chrome/browser/extensions/extension_tts_api_win.cc | 6 |
1 files changed, 5 insertions, 1 deletions
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; } |