[Scummvm-git-logs] scummvm master -> bce9ba0aec00d56f125b4de6a4157a080be6cddd
dreammaster
dreammaster at scummvm.org
Sat Sep 16 15:39:35 CEST 2017
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
bce9ba0aec TITANIC: Standardize audio rate constants
Commit: bce9ba0aec00d56f125b4de6a4157a080be6cddd
https://github.com/scummvm/scummvm/commit/bce9ba0aec00d56f125b4de6a4157a080be6cddd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-09-16T09:39:27-04:00
Commit Message:
TITANIC: Standardize audio rate constants
Changed paths:
engines/titanic/sound/audio_buffer.h
engines/titanic/sound/sound_manager.cpp
engines/titanic/sound/wave_file.cpp
diff --git a/engines/titanic/sound/audio_buffer.h b/engines/titanic/sound/audio_buffer.h
index 1f157b9..ad8c3e4 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 a4d838c..677ae0b 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 c1aab42..e57e9f0 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);
More information about the Scummvm-git-logs
mailing list