diff options
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(); |