aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/sound
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/sound')
-rw-r--r--engines/titanic/sound/sound.cpp1
-rw-r--r--engines/titanic/sound/wave_file.cpp4
-rw-r--r--engines/titanic/sound/wave_file.h5
3 files changed, 10 insertions, 0 deletions
diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp
index fb8cc299df..c28823148e 100644
--- a/engines/titanic/sound/sound.cpp
+++ b/engines/titanic/sound/sound.cpp
@@ -129,6 +129,7 @@ CWaveFile *CSound::loadSound(const CString &name) {
// Found it, so move it to the front of the list and return
_sounds.remove(soundItem);
_sounds.push_front(soundItem);
+ soundItem->_waveFile->reset();
return soundItem->_waveFile;
}
}
diff --git a/engines/titanic/sound/wave_file.cpp b/engines/titanic/sound/wave_file.cpp
index 2c583f2160..f2366d1dd5 100644
--- a/engines/titanic/sound/wave_file.cpp
+++ b/engines/titanic/sound/wave_file.cpp
@@ -106,4 +106,8 @@ uint CWaveFile::getFrequency() const {
return _stream->getRate();
}
+void CWaveFile::reset() {
+ _stream->rewind();
+}
+
} // End of namespace Titanic z
diff --git a/engines/titanic/sound/wave_file.h b/engines/titanic/sound/wave_file.h
index 19d367936f..e4bb71a0b6 100644
--- a/engines/titanic/sound/wave_file.h
+++ b/engines/titanic/sound/wave_file.h
@@ -81,6 +81,11 @@ public:
* Return the frequency of the loaded wave file
*/
uint getFrequency() const;
+
+ /**
+ * Resets the music stream
+ */
+ void reset();
};
} // End of namespace Titanic