aboutsummaryrefslogtreecommitdiff
path: root/engines/simon/sound.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/simon/sound.cpp')
-rw-r--r--engines/simon/sound.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/engines/simon/sound.cpp b/engines/simon/sound.cpp
index 88cc32b969..73c0f36589 100644
--- a/engines/simon/sound.cpp
+++ b/engines/simon/sound.cpp
@@ -494,6 +494,23 @@ void Sound::playSoundData(byte *soundData, uint sound, uint pan, uint vol, bool
}
}
+void Sound::playVoiceData(byte *soundData, uint sound) {
+ byte flags;
+ int rate;
+
+ int size = READ_LE_UINT32(soundData + 4);
+ Common::MemoryReadStream stream(soundData, size);
+ if (!loadWAVFromStream(stream, size, rate, flags)) {
+ error("playSoundData: Not a valid WAV data");
+ }
+
+ byte *buffer = (byte *)malloc(size);
+ memcpy(buffer, soundData + stream.pos(), size);
+
+ _mixer->stopHandle(_voiceHandle);
+ _mixer->playRaw(&_voiceHandle, buffer, size, rate, flags);
+}
+
void Sound::playEffects(uint sound) {
if (!_effects)
return;