diff options
| author | Jaromir Wysoglad | 2019-07-17 13:33:42 +0200 |
|---|---|---|
| committer | Filippos Karapetis | 2019-09-01 22:47:55 +0300 |
| commit | 33f8aadfeb81ead60ce1264f0af681dcdbd4931f (patch) | |
| tree | 445cc26d9d425eca0bf42a7c5ae436fb487916cc /backends/text-to-speech/windows | |
| parent | 318c6d7ec6e5562d0fd3e9d70386d0fcde86cf12 (diff) | |
| download | scummvm-rg350-33f8aadfeb81ead60ce1264f0af681dcdbd4931f.tar.gz scummvm-rg350-33f8aadfeb81ead60ce1264f0af681dcdbd4931f.tar.bz2 scummvm-rg350-33f8aadfeb81ead60ce1264f0af681dcdbd4931f.zip | |
TTS: Add age to TTSVoice
Diffstat (limited to 'backends/text-to-speech/windows')
| -rw-r--r-- | backends/text-to-speech/windows/windows-text-to-speech.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/backends/text-to-speech/windows/windows-text-to-speech.cpp b/backends/text-to-speech/windows/windows-text-to-speech.cpp index edadf5e667..6f621ed5d6 100644 --- a/backends/text-to-speech/windows/windows-text-to-speech.cpp +++ b/backends/text-to-speech/windows/windows-text-to-speech.cpp @@ -49,6 +49,7 @@ ISpAudio *_audio; WindowsTextToSpeechManager::WindowsTextToSpeechManager() : _speechState(BROKEN){ + ConfMan.setInt("tts_voice", 0); init(); } @@ -268,7 +269,19 @@ void WindowsTextToSpeechManager::createVoice(void *cpVoiceToken) { free(buffer); CoTaskMemFree(data); - _ttsState->_availaibleVoices.push_back(Common::TTSVoice(gender, (void *) voiceToken, desc)); + // age + hr = key->GetStringValue(L"Age", &data); + if (FAILED(hr)) { + voiceToken->Release(); + warning("Could not get the age attribute for voice: %s", desc.c_str()); + return; + } + buffer = Win32::unicodeToAnsi(data); + Common::TTSVoice::Age age = !strcmp(buffer, "Adult") ? Common::TTSVoice::ADULT : Common::TTSVoice::UNKNOWN_AGE; + free(buffer); + CoTaskMemFree(data); + + _ttsState->_availaibleVoices.push_back(Common::TTSVoice(gender, Common::TTSVoice::ADULT, (void *) voiceToken, desc)); } int strToInt(Common::String str) { |
