From bce9ba0aec00d56f125b4de6a4157a080be6cddd Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 16 Sep 2017 09:39:27 -0400 Subject: TITANIC: Standardize audio rate constants --- engines/titanic/sound/audio_buffer.h | 4 +++- engines/titanic/sound/sound_manager.cpp | 3 +-- engines/titanic/sound/wave_file.cpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'engines/titanic') 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 _data; + FixedQueue _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); -- cgit v1.2.3