diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-11-08 22:57:39 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-11-10 08:17:28 +0200 |
commit | 8f9c4efb11aaaae2c3c0a456aaeec99244c26308 (patch) | |
tree | 85c92a181048160b2870a4c1fbbad62081aaf6c0 /src | |
parent | 487e4b95d5d24710bce7c96dbd32d39d4e5fe2fc (diff) |
WinRT: don't emit Paused state if no pause was requested
If we start a synthesis process then we start the audio sink immediately
when the stream is ready. However, there might not be any data yet, so
the sink might transition briefly to suspended state, which we regularly
interpret as the text-to-speech state being paused.
Ignore such transitions if no pause was requested from the source.
This stabilizes the sayMultiple test, which without this change emits
too many state change signals and fails.
Pick-to: 6.6
Change-Id: I5158d0a0ebde6be37394cf114e1242f29df00ef2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/tts/winrt/qtexttospeech_winrt.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/tts/winrt/qtexttospeech_winrt.cpp b/src/plugins/tts/winrt/qtexttospeech_winrt.cpp index 9cb0b5d..61f665f 100644 --- a/src/plugins/tts/winrt/qtexttospeech_winrt.cpp +++ b/src/plugins/tts/winrt/qtexttospeech_winrt.cpp @@ -443,7 +443,8 @@ void QTextToSpeechEngineWinRTPrivate::sinkStateChanged(QAudio::State sinkState) state = QTextToSpeech::Speaking; break; case QAudio::SuspendedState: - state = QTextToSpeech::Paused; + if (audioSource->m_pause != AudioSource::NoPause) + state = QTextToSpeech::Paused; break; } if (state != oldState) |