aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorPaul Gilbert2017-09-16 09:39:27 -0400
committerPaul Gilbert2017-09-16 09:39:27 -0400
commitbce9ba0aec00d56f125b4de6a4157a080be6cddd (patch)
treee48c2c019d05a1b0296469fe745783fcbfe4bba3 /engines/titanic
parent5c901afad5d96127a472e76a7833a530f7e0e4ab (diff)
downloadscummvm-rg350-bce9ba0aec00d56f125b4de6a4157a080be6cddd.tar.gz
scummvm-rg350-bce9ba0aec00d56f125b4de6a4157a080be6cddd.tar.bz2
scummvm-rg350-bce9ba0aec00d56f125b4de6a4157a080be6cddd.zip
TITANIC: Standardize audio rate constants
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/sound/audio_buffer.h4
-rw-r--r--engines/titanic/sound/sound_manager.cpp3
-rw-r--r--engines/titanic/sound/wave_file.cpp2
3 files changed, 5 insertions, 4 deletions
diff --git a/engines/titanic/sound/audio_buffer.h b/engines/titanic/sound/audio_buffer.h
index 1f157b9346..ad8c3e4064 100644
--- a/engines/titanic/sound/audio_buffer.h
+++ b/engines/titanic/sound/audio_buffer.h
@@ -28,10 +28,12 @@
namespace Titanic {
+#define AUDIO_SAMPLING_RATE 22050
+
class CAudioBuffer {
private:
Common::Mutex _mutex;
- FixedQueue<int16, 88200> _data;
+ FixedQueue<int16, AUDIO_SAMPLING_RATE * 4> _data;
public:
bool _finished;
public:
diff --git a/engines/titanic/sound/sound_manager.cpp b/engines/titanic/sound/sound_manager.cpp
index a4d838ce2f..677ae0b7f3 100644
--- a/engines/titanic/sound/sound_manager.cpp
+++ b/engines/titanic/sound/sound_manager.cpp
@@ -26,7 +26,6 @@
namespace Titanic {
-const uint SAMPLING_RATE = 22050;
const uint LATENCY = 100;
const uint CHANNELS_COUNT = 16;
@@ -110,7 +109,7 @@ QSoundManager::QSoundManager(Audio::Mixer *mixer) : CSoundManager(), QMixer(mixe
Common::fill(&_channelsVolume[0], &_channelsVolume[16], 0);
Common::fill(&_channelsMode[0], &_channelsMode[16], 0);
- qsWaveMixInitEx(QMIXCONFIG(SAMPLING_RATE, CHANNELS_COUNT, LATENCY));
+ qsWaveMixInitEx(QMIXCONFIG(AUDIO_SAMPLING_RATE, CHANNELS_COUNT, LATENCY));
qsWaveMixActivate(true);
qsWaveMixOpenChannel(0, QMIX_OPENALL);
}
diff --git a/engines/titanic/sound/wave_file.cpp b/engines/titanic/sound/wave_file.cpp
index c1aab42a7f..e57e9f0ee2 100644
--- a/engines/titanic/sound/wave_file.cpp
+++ b/engines/titanic/sound/wave_file.cpp
@@ -188,7 +188,7 @@ const int16 *CWaveFile::lock() {
switch (_loadMode) {
case LOADMODE_SCUMMVM:
// Sanity checking that only raw 16-bit LE 22Khz waves can be locked
- assert(_waveData && _rate == 22050);
+ assert(_waveData && _rate == AUDIO_SAMPLING_RATE);
assert(_flags == (Audio::FLAG_LITTLE_ENDIAN | Audio::FLAG_16BITS));
assert(_wavType == kWaveFormatPCM);