aboutsummaryrefslogtreecommitdiff
path: root/common/text-to-speech.cpp
diff options
context:
space:
mode:
authorJaromir Wysoglad2019-07-22 19:39:20 +0200
committerFilippos Karapetis2019-09-01 22:47:55 +0300
commit33549d9c0225a1ecfc5924b5584cdcee466498cc (patch)
treec010622e0d2b34fe747fd5b695dbb05a26dc216b /common/text-to-speech.cpp
parent134d955006072720031c989a151ee14875bfcf05 (diff)
downloadscummvm-rg350-33549d9c0225a1ecfc5924b5584cdcee466498cc.tar.gz
scummvm-rg350-33549d9c0225a1ecfc5924b5584cdcee466498cc.tar.bz2
scummvm-rg350-33549d9c0225a1ecfc5924b5584cdcee466498cc.zip
TTS: Add getVoiceIndicesByGender to the base class
This is a way to easily get a list of voices with the given gender
Diffstat (limited to 'common/text-to-speech.cpp')
-rw-r--r--common/text-to-speech.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/text-to-speech.cpp b/common/text-to-speech.cpp
index 5bdf05e4dc..9289cba214 100644
--- a/common/text-to-speech.cpp
+++ b/common/text-to-speech.cpp
@@ -132,5 +132,14 @@ TTSVoice TextToSpeechManager::getVoice() {
return TTSVoice();
}
+Array<int> TextToSpeechManager::getVoiceIndicesByGender(TTSVoice::Gender gender) {
+ Array<int> results;
+ for (unsigned i = 0; i < _ttsState->_availableVoices.size(); i++) {
+ if (_ttsState->_availableVoices[i].getGender() == gender)
+ results.push_back(i);
+ }
+ return results;
+}
+
}
#endif