diff options
author | Jaromir Wysoglad | 2019-07-18 23:53:52 +0200 |
---|---|---|
committer | Filippos Karapetis | 2019-09-01 22:47:55 +0300 |
commit | b5d5576f90c177c54170a4e68b251c2fd5219260 (patch) | |
tree | ad3dbb3d8085cfa02ebb50920264cb2268b9efb4 /backends | |
parent | 788b15652db9c5d062520c3202d30c827fd6fe21 (diff) | |
download | scummvm-rg350-b5d5576f90c177c54170a4e68b251c2fd5219260.tar.gz scummvm-rg350-b5d5576f90c177c54170a4e68b251c2fd5219260.tar.bz2 scummvm-rg350-b5d5576f90c177c54170a4e68b251c2fd5219260.zip |
TTS: Add check to getVoice, fix typo.
Check if _availableVoices isn't empty.
Replace availaible with available
Diffstat (limited to 'backends')
-rw-r--r-- | backends/text-to-speech/linux/linux-text-to-speech.cpp | 6 | ||||
-rw-r--r-- | backends/text-to-speech/windows/windows-text-to-speech.cpp | 14 |
2 files changed, 10 insertions, 10 deletions
diff --git a/backends/text-to-speech/linux/linux-text-to-speech.cpp b/backends/text-to-speech/linux/linux-text-to-speech.cpp index 4b01b4478b..9abe805767 100644 --- a/backends/text-to-speech/linux/linux-text-to-speech.cpp +++ b/backends/text-to-speech/linux/linux-text-to-speech.cpp @@ -184,8 +184,8 @@ bool LinuxTextToSpeechManager::isReady() { void LinuxTextToSpeechManager::setVoice(unsigned index) { if (_speechState == BROKEN) return; - assert(index < _ttsState->_availaibleVoices.size()); - Common::TTSVoice voice = _ttsState->_availaibleVoices[index]; + assert(index < _ttsState->_availableVoices.size()); + Common::TTSVoice voice = _ttsState->_availableVoices[index]; spd_set_voice_type(_connection, *(SPDVoiceType *)(voice.getData())); _ttsState->_activeVoice = index; } @@ -230,7 +230,7 @@ void LinuxTextToSpeechManager::createVoice(int typeNumber, Common::TTSVoice::Gen SPDVoiceType *type = (SPDVoiceType *) malloc(sizeof(SPDVoiceType)); *type = static_cast<SPDVoiceType>(typeNumber); Common::TTSVoice voice(gender, age, (void *) type, description); - _ttsState->_availaibleVoices.push_back(voice); + _ttsState->_availableVoices.push_back(voice); } void LinuxTextToSpeechManager::updateVoices() { 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 0625bc8d52..575c72b41f 100644 --- a/backends/text-to-speech/windows/windows-text-to-speech.cpp +++ b/backends/text-to-speech/windows/windows-text-to-speech.cpp @@ -79,7 +79,7 @@ void WindowsTextToSpeechManager::init() { _audio->SetFormat(format.FormatId(), format.WaveFormatExPtr()); _voice->SetOutput(_audio, FALSE); - if(_ttsState->_availaibleVoices.size() > 0) + if(_ttsState->_availableVoices.size() > 0) _speechState = READY; else _speechState = NO_VOICE; @@ -180,7 +180,7 @@ bool WindowsTextToSpeechManager::isReady() { void WindowsTextToSpeechManager::setVoice(unsigned index) { if(_speechState == BROKEN || _speechState == NO_VOICE) return; - _voice->SetVoice((ISpObjectToken *) _ttsState->_availaibleVoices[index].getData()); + _voice->SetVoice((ISpObjectToken *) _ttsState->_availableVoices[index].getData()); } void WindowsTextToSpeechManager::setRate(int rate) { @@ -211,11 +211,11 @@ int WindowsTextToSpeechManager::getVolume() { } void WindowsTextToSpeechManager::freeVoices() { - for(Common::TTSVoice *i = _ttsState->_availaibleVoices.begin(); i < _ttsState->_availaibleVoices.end(); i++) { + for(Common::TTSVoice *i = _ttsState->_availableVoices.begin(); i < _ttsState->_availableVoices.end(); i++) { ISpObjectToken *voiceData = (ISpObjectToken *)i->getData(); voiceData->Release(); } - _ttsState->_availaibleVoices.clear(); + _ttsState->_availableVoices.clear(); } void WindowsTextToSpeechManager::setLanguage(Common::String language) { @@ -290,7 +290,7 @@ void WindowsTextToSpeechManager::createVoice(void *cpVoiceToken) { free(buffer); CoTaskMemFree(data); - _ttsState->_availaibleVoices.push_back(Common::TTSVoice(gender, Common::TTSVoice::ADULT, (void *) voiceToken, desc)); + _ttsState->_availableVoices.push_back(Common::TTSVoice(gender, Common::TTSVoice::ADULT, (void *) voiceToken, desc)); } int strToInt(Common::String str) { @@ -340,9 +340,9 @@ void WindowsTextToSpeechManager::updateVoices() { _voice->SetVolume(_ttsState->_volume); cpEnum->Release(); - if(_ttsState->_availaibleVoices.size() == 0) { + if(_ttsState->_availableVoices.size() == 0) { _speechState = NO_VOICE; - warning("No voice is availaible"); + warning("No voice is available"); } else if (_speechState == NO_VOICE) _speechState = READY; } |