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/text-to-speech/windows | |
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/text-to-speech/windows')
-rw-r--r-- | backends/text-to-speech/windows/windows-text-to-speech.cpp | 14 |
1 files changed, 7 insertions, 7 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 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; } |