From bc101179804bddbb312a0e7ec79df3a29605c2ad Mon Sep 17 00:00:00 2001 From: Jaromir Wysoglad Date: Mon, 5 Aug 2019 00:23:15 +0200 Subject: TTS: Restart SPD if resume() fails. --- backends/text-to-speech/linux/linux-text-to-speech.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'backends/text-to-speech') 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 20ba07d74d..cc506db333 100644 --- a/backends/text-to-speech/linux/linux-text-to-speech.cpp +++ b/backends/text-to-speech/linux/linux-text-to-speech.cpp @@ -218,8 +218,12 @@ bool LinuxTextToSpeechManager::resume() { if (_speechQueue.size()) { _speechState = SPEAKING; for (Common::List::iterator i = _speechQueue.begin(); i != _speechQueue.end(); i++) { - if (spd_say(_connection, SPD_MESSAGE, i->c_str()) == -1) + if (spd_say(_connection, SPD_MESSAGE, i->c_str()) == -1) { + if (_connection != 0) + spd_close(_connection); + init(); return true; + } } } else -- cgit v1.2.3