aboutsummaryrefslogtreecommitdiff
path: root/backends/text-to-speech/windows
diff options
context:
space:
mode:
authorJaromir Wysoglad2019-07-17 13:33:42 +0200
committerFilippos Karapetis2019-09-01 22:47:55 +0300
commit33f8aadfeb81ead60ce1264f0af681dcdbd4931f (patch)
tree445cc26d9d425eca0bf42a7c5ae436fb487916cc /backends/text-to-speech/windows
parent318c6d7ec6e5562d0fd3e9d70386d0fcde86cf12 (diff)
downloadscummvm-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.cpp15
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) {