aboutsummaryrefslogtreecommitdiff
path: root/engines/startrek/sound.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/startrek/sound.cpp')
-rw-r--r--engines/startrek/sound.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/engines/startrek/sound.cpp b/engines/startrek/sound.cpp
index 553d011c25..128c968820 100644
--- a/engines/startrek/sound.cpp
+++ b/engines/startrek/sound.cpp
@@ -212,9 +212,11 @@ void Sound::playSpeech(const Common::String &basename) {
error("Couldn't open '%s'", filename.c_str());
Audio::AudioStream *audioStream = Audio::makeVOCStream(readStream, Audio::FLAG_UNSIGNED, DisposeAfterUse::YES);
- if (audioQueue == nullptr)
- audioQueue = Audio::makeQueuingAudioStream(audioStream->getRate(), audioStream->isStereo());
- audioQueue->queueAudioStream(audioStream, DisposeAfterUse::YES);
+ if (audioStream != nullptr) {
+ if (audioQueue == nullptr)
+ audioQueue = Audio::makeQueuingAudioStream(audioStream->getRate(), audioStream->isStereo());
+ audioQueue->queueAudioStream(audioStream, DisposeAfterUse::YES);
+ }
name.erase(0,i+1);
}
@@ -222,9 +224,8 @@ void Sound::playSpeech(const Common::String &basename) {
if (audioQueue != nullptr) {
audioQueue->finish();
_vm->_system->getMixer()->playStream(Audio::Mixer::kSpeechSoundType, &_speechHandle, audioQueue);
+ _playingSpeech = true;
}
-
- _playingSpeech = true;
}
/**