aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2003-12-27 21:14:57 +0000
committerMax Horn2003-12-27 21:14:57 +0000
commitaf2d9b9a163fa9d8d3f35e692f73c12872886f52 (patch)
tree41450e35ddfeac7f561930ea1e28368a2c222588 /scumm
parentf8dac71c8faeb08fb52e606d47e8cb9f03961351 (diff)
downloadscummvm-rg350-af2d9b9a163fa9d8d3f35e692f73c12872886f52.tar.gz
scummvm-rg350-af2d9b9a163fa9d8d3f35e692f73c12872886f52.tar.bz2
scummvm-rg350-af2d9b9a163fa9d8d3f35e692f73c12872886f52.zip
fix volume problems (I think...)
svn-id: r11979
Diffstat (limited to 'scumm')
-rw-r--r--scumm/imuse_digi.cpp17
-rw-r--r--scumm/imuse_digi.h1
2 files changed, 10 insertions, 8 deletions
diff --git a/scumm/imuse_digi.cpp b/scumm/imuse_digi.cpp
index 9f9c64ec5e..40145a1150 100644
--- a/scumm/imuse_digi.cpp
+++ b/scumm/imuse_digi.cpp
@@ -699,7 +699,7 @@ void IMuseDigital::callback() {
if (_channel[l].used) {
assert(_channel[l].stream);
- if (!_channel[l].handle.isActive()) {
+ if (!_channel[l].handle.isActive() && _channel[l].started) {
debug(5, "IMuseDigital::callback(): stopped sound: %d", _channel[l].idSound);
delete _channel[l].stream;
_channel[l].stream = 0;
@@ -733,11 +733,13 @@ void IMuseDigital::callback() {
if (_scumm->_mixer->isReady()) {
int pan = (_channel[l].pan != 64) ? 2 * _channel[l].pan - 127 : 0;
- // FIXME: For whatever reasons, vol gets set to extremly low values, which
- // results in the affected sounds not really being audible (e.g. volume
- // 8 out of 255 is *really* quiet).
-// _scumm->_mixer->setChannelVolume(_channel[l].handle, _channel[l].vol / 1000);
- _scumm->_mixer->setChannelPan(_channel[l].handle, pan);
+ if (!_channel[l].started) {
+ _channel[l].started = true;
+ _scumm->_mixer->playInputStream(&_channel[l].handle, _channel[l].stream, true, _channel[l].vol / 1000, _channel[l].pan, -1, false);
+ } else {
+ _scumm->_mixer->setChannelVolume(_channel[l].handle, _channel[l].vol / 1000);
+ _scumm->_mixer->setChannelPan(_channel[l].handle, pan);
+ }
}
}
}
@@ -935,8 +937,7 @@ void IMuseDigital::startSound(int sound, byte *voc_src, int voc_size, int voc_ra
// Create an AudioInputStream and hook it to the mixer.
_channel[l].stream = makeLinearInputStream(freq, mixerFlags | SoundMixer::FLAG_AUTOFREE, data, size, 0, 0);
- _scumm->_mixer->playInputStream(&_channel[l].handle, _channel[l].stream, true, _channel[l].vol / 1000, _channel[l].pan, -1, false);
-
+ _channel[l].started = false;
_channel[l].used = true;
return;
}
diff --git a/scumm/imuse_digi.h b/scumm/imuse_digi.h
index 28e5fa3e4f..0cfda38aa1 100644
--- a/scumm/imuse_digi.h
+++ b/scumm/imuse_digi.h
@@ -79,6 +79,7 @@ private:
int idSound;
bool used;
+ bool started;
PlayingSoundHandle handle;
AudioInputStream *stream;