diff options
Diffstat (limited to 'backends/text-to-speech/linux/linux-text-to-speech.cpp')
-rw-r--r-- | backends/text-to-speech/linux/linux-text-to-speech.cpp | 21 |
1 files changed, 21 insertions, 0 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 9f330bc997..1e92742845 100644 --- a/backends/text-to-speech/linux/linux-text-to-speech.cpp +++ b/backends/text-to-speech/linux/linux-text-to-speech.cpp @@ -230,4 +230,25 @@ void LinuxTextToSpeechManager::updateVoices() { } +bool LinuxTextToSpeechManager::popState() { + if (_ttsState->_next == nullptr) + return true; + + for (Common::TTSVoice *i = _ttsState->_availaibleVoices.begin(); i < _ttsState->_availaibleVoices.end(); i++) { + free(i->getData()); + } + + Common::TTSState *oldState = _ttsState; + _ttsState = _ttsState->_next; + + delete oldState; + + setLanguage(_ttsState->_language); + setPitch(_ttsState->_pitch); + setVolume(_ttsState->_volume); + setRate(_ttsState->_rate); + return false; +} + + #endif |