aboutsummaryrefslogtreecommitdiff
path: root/simon/sound.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'simon/sound.cpp')
-rw-r--r--simon/sound.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/simon/sound.cpp b/simon/sound.cpp
index c7519e7ead..81d2c9c0a8 100644
--- a/simon/sound.cpp
+++ b/simon/sound.cpp
@@ -422,6 +422,9 @@ void SimonSound::readVoiceFile(const char *filename, const char *gameDataPath) {
}
}
+ if (_voice)
+ delete _voice;
+
_voice = new RawSound(_mixer, file, 0, SOUND_BIG_ENDIAN);
}
@@ -434,6 +437,9 @@ void SimonSound::playVoice(uint sound) {
if (file->isOpen() == false) {
warning("Can't open voice file %s", filename);
} else {
+ if (_voice)
+ delete _voice;
+
_voice = new WavSound(_mixer, file, _offsets);
}
}