diff options
-rw-r--r-- | simon/sound.cpp | 7 | ||||
-rw-r--r-- | simon/sound.h | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/simon/sound.cpp b/simon/sound.cpp index 8eec4222b2..07ba874efd 100644 --- a/simon/sound.cpp +++ b/simon/sound.cpp @@ -117,7 +117,7 @@ void SimonSound::playVoice(uint sound) if (!_voice) return; - _voice->playSound(sound, &_voice_handle); + _voice_index = _voice->playSound(sound, &_voice_handle); } void SimonSound::playEffects(uint sound) @@ -155,6 +155,11 @@ bool SimonSound::hasVoice() return _voice != NULL; } +void SimonSound::stopVoice() +{ + _mixer->stop(_voice_index); +} + void SimonSound::stopAll() { _mixer->stopAll(); diff --git a/simon/sound.h b/simon/sound.h index 88f2e4afaa..3ad0564528 100644 --- a/simon/sound.h +++ b/simon/sound.h @@ -52,6 +52,7 @@ private: }; byte _game; + int _voice_index; int _ambient_index; SoundMixer *_mixer; @@ -78,6 +79,7 @@ public: void playAmbient(uint sound); bool hasVoice(); + void stopVoice(); void stopAll(); void effectsPause(bool b); void ambientPause(bool b); |