From 3027acc12e97fe92f617dd4a95a5861625773c38 Mon Sep 17 00:00:00 2001 From: Jaromir Wysoglad Date: Fri, 19 Jul 2019 09:56:26 +0200 Subject: TTS: Minor refactorisations - Add comment to tts initialization on Windows - Correctly free the voicesInfo in linux ttsMan - Remove popState method from linux-text-to-speech.h and windows-text-to-speech.h - Add tts to help in configure - Refactor language setting in gui-manager.cpp It counted with english being the default language in ttsMan constructors, which isn't true anymore. --- backends/platform/sdl/win32/win32.cpp | 2 ++ backends/text-to-speech/linux/linux-text-to-speech.cpp | 5 +++++ backends/text-to-speech/linux/linux-text-to-speech.h | 2 -- backends/text-to-speech/windows/windows-text-to-speech.h | 2 -- 4 files changed, 7 insertions(+), 4 deletions(-) (limited to 'backends') diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp index 4b0961bc3c..4328773c36 100644 --- a/backends/platform/sdl/win32/win32.cpp +++ b/backends/platform/sdl/win32/win32.cpp @@ -119,6 +119,8 @@ void OSystem_Win32::initBackend() { // Initialize updates manager _updateManager = new Win32UpdateManager(); #endif + + // Initialize text to speech #ifdef USE_WINDOWS_TTS _textToSpeechManager = new WindowsTextToSpeechManager(); #endif 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 9abe805767..d6195229c5 100644 --- a/backends/text-to-speech/linux/linux-text-to-speech.cpp +++ b/backends/text-to-speech/linux/linux-text-to-speech.cpp @@ -256,6 +256,11 @@ void LinuxTextToSpeechManager::updateVoices() { createVoice(SPD_CHILD_MALE, Common::TTSVoice::MALE, Common::TTSVoice::CHILD, voiceInfo[6]); createVoice(SPD_CHILD_FEMALE, Common::TTSVoice::FEMALE, Common::TTSVoice::CHILD, voiceInfo[7]); + for (int i = 0; i < 8; i++) + free(voiceInfo[i]); + + free(voiceInfo); + } void LinuxTextToSpeechManager::freeVoiceData(void *data) { 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 feb595095e..a6994f7f40 100644 --- a/backends/text-to-speech/linux/linux-text-to-speech.h +++ b/backends/text-to-speech/linux/linux-text-to-speech.h @@ -63,8 +63,6 @@ public: virtual void setLanguage(Common::String language); - bool popState(); - void updateState(SpeechState state); virtual void freeVoiceData(void *data); diff --git a/backends/text-to-speech/windows/windows-text-to-speech.h b/backends/text-to-speech/windows/windows-text-to-speech.h index 6498c9cc2c..87e4ceb218 100644 --- a/backends/text-to-speech/windows/windows-text-to-speech.h +++ b/backends/text-to-speech/windows/windows-text-to-speech.h @@ -64,8 +64,6 @@ public: virtual void setLanguage(Common::String language); - bool popState(); - virtual void freeVoiceData(void *data); private: -- cgit v1.2.3