[Scummvm-devel] Audio volume control (proposed mixer/imuse/... changes)
Pawel Kolodziejski
pablo at omega.xtr.net.pl
Sun Nov 28 12:47:08 CET 2004
>
> Essentially, iMuseDigital already divides sound data into three (or
> really: four) groups:
> - sfx
> - muxic
> - speech
> - none / global (group 0)
actually that "none/global" is not used by imuse, it's only changed by
user(in imuse context), and it's after that 3 groups.
>
> And that matches exactly with my proposal. For iMuseDigital, the main
> visible change would be that the sfx/music/speech volume effect would
> not be done inside iMuseDigital anymore, but rather inside the mixer.
> Consider this code fragment (from dimuse.cpp):
>
> int vol = track->vol / 1000;
> if (track->volGroupId == 1)
> vol = (vol * _volVoice) / 128;
> if (track->volGroupId == 2)
> vol = (vol * _volSfx) / 128;
> if (track->volGroupId == 3)
> vol = (vol * _volMusic) / 128;
> track->mixerVol = vol;
>
> This would probably end up looking like this:
> if (track->volGroupId == 1)
> track->audioType = SoundMixer::kSpeechAudioDataType;
> else if (track->volGroupId == 2)
> track->audioType = SoundMixer::kSFXAudioDataType;
> else if (track->volGroupId == 3)
> track->audioType = SoundMixer::kMusicAudioDataType;
> track->mixerVol = track->vol / 1000;
>
> and then later, the value of track->audioType would be passed to
> SoundMixer::playInputStream.
>
so, as i thought.
Pawel
More information about the Scummvm-devel
mailing list