Commit a0982ec4 authored by dmazzoni@chromium.org's avatar dmazzoni@chromium.org

Fix implementation of StopSpeaking, and implement IsSpeaking, for the

Windows-native implementation of the TTS API.

BUG=none
TEST=manual testing

Review URL: http://codereview.chromium.org/6249014

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72439 0039d316-1c4b-4281-b951-d872f2087c98
parent 5bf0bc2f
...@@ -94,7 +94,7 @@ bool ExtensionTtsPlatformImplWin::Speak( ...@@ -94,7 +94,7 @@ bool ExtensionTtsPlatformImplWin::Speak(
} }
bool ExtensionTtsPlatformImplWin::StopSpeaking() { bool ExtensionTtsPlatformImplWin::StopSpeaking() {
if (!speech_synthesizer_ && !paused_) { if (speech_synthesizer_ && !paused_) {
speech_synthesizer_->Pause(); speech_synthesizer_->Pause();
paused_ = true; paused_ = true;
} }
...@@ -102,6 +102,12 @@ bool ExtensionTtsPlatformImplWin::StopSpeaking() { ...@@ -102,6 +102,12 @@ bool ExtensionTtsPlatformImplWin::StopSpeaking() {
} }
bool ExtensionTtsPlatformImplWin::IsSpeaking() { bool ExtensionTtsPlatformImplWin::IsSpeaking() {
if (speech_synthesizer_ && !paused_) {
SPVOICESTATUS status;
HRESULT result = speech_synthesizer_->GetStatus(&status, NULL);
if (result == S_OK && status.dwRunningState == SPRS_IS_SPEAKING)
return true;
}
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment