aboutsummaryrefslogtreecommitdiff
path: root/backends/text-to-speech/windows/windows-text-to-speech.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/text-to-speech/windows/windows-text-to-speech.cpp')
-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) {