aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/sound/music.cpp7
-rw-r--r--engines/sci/sound/music.h1
-rw-r--r--engines/sci/sound/soundcmd.cpp2
3 files changed, 9 insertions, 1 deletions
diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp
index e2540e1a8f..e90329a879 100644
--- a/engines/sci/sound/music.cpp
+++ b/engines/sci/sound/music.cpp
@@ -431,6 +431,13 @@ void SciMusic::soundSetVolume(MusicEntry *pSnd, byte volume) {
}
}
+// this is used to set volume of the sample, used for fading only!
+void SciMusic::soundSetSampleVolume(MusicEntry *pSnd, byte volume) {
+ assert(volume <= MUSIC_VOLUME_MAX);
+ assert(pSnd->pStreamAud);
+ _pMixer->setChannelVolume(pSnd->hCurrentAud, volume * 2); // Mixer is 0-255, SCI is 0-127
+}
+
void SciMusic::soundSetPriority(MusicEntry *pSnd, byte prio) {
Common::StackLock lock(_mutex);
diff --git a/engines/sci/sound/music.h b/engines/sci/sound/music.h
index b10f64aa18..21d930fc9a 100644
--- a/engines/sci/sound/music.h
+++ b/engines/sci/sound/music.h
@@ -148,6 +148,7 @@ public:
void soundResume(MusicEntry *pSnd);
void soundToggle(MusicEntry *pSnd, bool pause);
void soundSetVolume(MusicEntry *pSnd, byte volume);
+ void soundSetSampleVolume(MusicEntry *pSnd, byte volume);
void soundSetPriority(MusicEntry *pSnd, byte prio);
uint16 soundGetMasterVolume();
void soundSetMasterVolume(uint16 vol);
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index 84aedc8515..c5bb7fa707 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -402,7 +402,7 @@ void SoundCommandParser::processUpdateCues(reg_t obj) {
}
// We get a flag from MusicEntry::doFade() here to set volume for the stream
if (musicSlot->fadeSetVolume) {
- _music->soundSetVolume(musicSlot, musicSlot->volume);
+ _music->soundSetSampleVolume(musicSlot, musicSlot->volume);
musicSlot->fadeSetVolume = false;
}
} else if (musicSlot->pMidiParser) {