diff options
author | Robert Göffringmann | 2004-01-06 11:48:30 +0000 |
---|---|---|
committer | Robert Göffringmann | 2004-01-06 11:48:30 +0000 |
commit | e34d7b6c41054fb1093a1967639d2a328eabd5f8 (patch) | |
tree | 841d0036eb2eeb73dcb90a589c66c354cc7b5d69 /sword1/sound.cpp | |
parent | cc67301791cd46bc6e81bb76ef30c45d692a7547 (diff) | |
download | scummvm-rg350-e34d7b6c41054fb1093a1967639d2a328eabd5f8.tar.gz scummvm-rg350-e34d7b6c41054fb1093a1967639d2a328eabd5f8.tar.bz2 scummvm-rg350-e34d7b6c41054fb1093a1967639d2a328eabd5f8.zip |
get volume from gamedetector
svn-id: r12169
Diffstat (limited to 'sword1/sound.cpp')
-rw-r--r-- | sword1/sound.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sword1/sound.cpp b/sword1/sound.cpp index 2ded6fa9ee..e9cb523b5a 100644 --- a/sword1/sound.cpp +++ b/sword1/sound.cpp @@ -36,6 +36,12 @@ SwordSound::SwordSound(const char *searchPath, SoundMixer *mixer, ResMan *pResMa _cowHeader = NULL; _endOfQueue = 0; _currentCowFile = 0; + _speechVol = _sfxVol = 192; +} + +void SwordSound::setVolume(uint8 sfxVol, uint8 speechVol) { + _sfxVol = sfxVol; + _speechVol = speechVol; } int SwordSound::addToQueue(int32 fxNo) { @@ -138,6 +144,7 @@ void SwordSound::playSample(QueueElement *elem) { uint8 volR = _fxList[elem->id].roomVolList[cnt].rightVol * 10; int8 pan = (volR - volL) / 2; uint8 volume = (volR + volL) / 2; + volume = (volume * _sfxVol) >> 8; uint32 size = READ_LE_UINT32(sampleData + 0x28); uint8 flags; if (READ_LE_UINT16(sampleData + 0x22) == 16) @@ -167,7 +174,7 @@ bool SwordSound::startSpeech(uint16 roomNo, uint16 localNo) { uint32 size; int16 *data = uncompressSpeech(index + _cowHeaderSize, sampleSize, &size); if (data) - _mixer->playRaw(&_speechHandle, data, size, 11025, SPEECH_FLAGS, SOUND_SPEECH_ID); + _mixer->playRaw(&_speechHandle, data, size, 11025, SPEECH_FLAGS, SOUND_SPEECH_ID, _speechVol); return true; } else return false; |