From feaba6fff62d92c057579d9a95ed085d8bd3d159 Mon Sep 17 00:00:00 2001 From: Jaromir Wysoglad Date: Fri, 2 Aug 2019 01:12:02 -0700 Subject: TTS: Reimplement isSpeaking on Windows. --- backends/text-to-speech/windows/windows-text-to-speech.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'backends/text-to-speech/windows/windows-text-to-speech.cpp') diff --git a/backends/text-to-speech/windows/windows-text-to-speech.cpp b/backends/text-to-speech/windows/windows-text-to-speech.cpp index 196a909f2e..0731239054 100644 --- a/backends/text-to-speech/windows/windows-text-to-speech.cpp +++ b/backends/text-to-speech/windows/windows-text-to-speech.cpp @@ -165,9 +165,11 @@ bool WindowsTextToSpeechManager::resume() { bool WindowsTextToSpeechManager::isSpeaking() { if(_speechState == BROKEN || _speechState == NO_VOICE) return false; - SPVOICESTATUS eventStatus; - _voice->GetStatus(&eventStatus, NULL); - return eventStatus.dwRunningState == SPRS_IS_SPEAKING; + SPAUDIOSTATUS audioStatus; + SPVOICESTATUS voiceStatus; + _audio->GetStatus(&audioStatus); + _voice->GetStatus(&voiceStatus, NULL); + return audioStatus.State != SPAS_CLOSED || voiceStatus.dwRunningState != SPRS_DONE; } bool WindowsTextToSpeechManager::isPaused() { -- cgit v1.2.3