Commit 0031c478 authored by jwendt's avatar jwendt
Browse files

minor changes to the TTS interface to retrieve available voices

parent c99f4e0d
......@@ -160,14 +160,16 @@ CVAStruct CVATextToSpeechSignalSource::GetParameters( const CVAStruct& oArgs ) c
int num_voices = CPRCEN_engine_get_voice_count(TTSEngine::getInstance().getEngine());
oRet["number"] = num_voices;
for (int i = 0; i < num_voices; i++) {
CVAStruct oVoice;
std::string voicename = CPRCEN_engine_get_voice_info(TTSEngine::getInstance().getEngine(), i, "VOICE_NAME");
oRet["voice_" + std::to_string(i)] = voicename;
oVoice["name"] = voicename;
std::string language = CPRCEN_engine_get_voice_info(TTSEngine::getInstance().getEngine(), i, "LANGUAGE_CODE_ISO");
oRet["language_" + std::to_string(i)] = language;
oVoice["language"] = language;
std::string country = CPRCEN_engine_get_voice_info(TTSEngine::getInstance().getEngine(), i, "COUNTRY_CODE_ISO");
oRet["country_" + std::to_string(i)] = country;
oVoice["country"] = country;
std::string sex = CPRCEN_engine_get_voice_info(TTSEngine::getInstance().getEngine(), i, "SEX");
oRet["sex_" + std::to_string(i)] = sex;
oVoice["sex"] = sex;
oRet[std::to_string(i)] = oVoice;
}
return oRet;
}
......
......@@ -63,10 +63,11 @@ public:
* ["list_voices"] = true
* and returns a CVAStruct with:
* ["number"] = the number of available voices
* ["voice_i"] = the name of the voice, where i is 0...["number"]-1
* ["sex_i"] = the sex of the voice, i.e. "male" or "female"; where i is 0...["number"]-1
* ["language_i"] = the language of the voice, e.g. "en" or "de"; where i is 0...["number"]-1
* ["country_i"] = the country of the voice, e.g. "GB" or "US"; where i is 0...["number"]-1
* ["i"] = where i is an index from 0...["number"]-1 which itself is a CVAStruct with
* ["name"] = the name of the voice
* ["sex"] = the sex of the voice, i.e. "male" or "female"
* ["language"] = the language of the voice, e.g. "en" or "de"
* ["country"] = the country of the voice, e.g. "GB" or "US"
*/
CVAStruct GetParameters( const CVAStruct& ) const;
void Reset();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment