diff options
| author | Jaromir Wysoglad | 2019-07-31 15:10:12 +0200 |
|---|---|---|
| committer | Filippos Karapetis | 2019-09-01 22:47:55 +0300 |
| commit | 6703f88f7f91bc22ce5ea3593a1699f1dc4fa7c0 (patch) | |
| tree | b277c6509b1bd632669b5de0fd1d0f66a567b880 /backends/text-to-speech/linux | |
| parent | bbbb608c528699f281fdd5a8a7d814dd44b9aa41 (diff) | |
| download | scummvm-rg350-6703f88f7f91bc22ce5ea3593a1699f1dc4fa7c0.tar.gz scummvm-rg350-6703f88f7f91bc22ce5ea3593a1699f1dc4fa7c0.tar.bz2 scummvm-rg350-6703f88f7f91bc22ce5ea3593a1699f1dc4fa7c0.zip | |
TTS: Implement speech queueing on Linux and Win
Diffstat (limited to 'backends/text-to-speech/linux')
| -rw-r--r-- | backends/text-to-speech/linux/linux-text-to-speech.cpp | 7 | ||||
| -rw-r--r-- | backends/text-to-speech/linux/linux-text-to-speech.h | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/backends/text-to-speech/linux/linux-text-to-speech.cpp b/backends/text-to-speech/linux/linux-text-to-speech.cpp index 828eb877b3..a2a09aebdc 100644 --- a/backends/text-to-speech/linux/linux-text-to-speech.cpp +++ b/backends/text-to-speech/linux/linux-text-to-speech.cpp @@ -128,9 +128,12 @@ Common::String LinuxTextToSpeechManager::strToUtf8(Common::String str, Common::S #endif } -bool LinuxTextToSpeechManager::say(Common::String str, Common::String charset) { +bool LinuxTextToSpeechManager::say(Common::String str, Action action, Common::String charset) { if (_speechState == BROKEN) return true; + + if (action == DROP && isSpeaking()) + return true; if (charset.empty()) { #ifdef USE_TRANSLATION @@ -142,7 +145,7 @@ bool LinuxTextToSpeechManager::say(Common::String str, Common::String charset) { str = strToUtf8(str, charset); - if (isSpeaking()) + if (isSpeaking() && action == INTERRUPT) stop(); if(spd_say(_connection, SPD_MESSAGE, str.c_str()) == -1) { //restart the connection diff --git a/backends/text-to-speech/linux/linux-text-to-speech.h b/backends/text-to-speech/linux/linux-text-to-speech.h index fe7eab8ed5..49701abb4c 100644 --- a/backends/text-to-speech/linux/linux-text-to-speech.h +++ b/backends/text-to-speech/linux/linux-text-to-speech.h @@ -42,7 +42,7 @@ public: LinuxTextToSpeechManager(); virtual ~LinuxTextToSpeechManager(); - virtual bool say(Common::String str, Common::String charset = ""); + virtual bool say(Common::String str, Action action, Common::String charset = ""); virtual bool stop(); virtual bool pause(); |
