Interrupt / systemshock

Shockolate - A minimalist and cross platform System Shock source port.
GNU General Public License v3.0
811 stars 66 forks source link

Some music channels ignore the volume setting #210

Closed Interrupt closed 6 years ago

Interrupt commented 6 years ago

The way we're setting music volume right now seems to ignore the master music volume sometimes. You can see this on the title screen by trying to set the volume to 0 at setup.c: 1503

A better way of setting the music volume might be to manually adjust the values being streamed into SDL in the callback, until the bug affecting SDL_Mixer's music volume setting on Windows is fixed.

donnierussellii commented 6 years ago

I tried varying the volume this way. The sound very audibly pops at various times: when the game starts (several random loud pops), when you're moving the volume slider, or anytime the volume changes in general. I couldn't figure out what I was doing wrong, so gave it up.

Deleted PR #211 because it's no longer needed (see below).

Interrupt commented 6 years ago

Maybe we should be using SDL_Mixer's music volume function then, and lean on them to fix the library rather than trying to work around it?

Alternatively, and more hacky, the MIDI commands to set volume on a channel would need to take into account the global music volume setting and not just rely on the data being fed to them.

Edit: Would this function help anything? https://wiki.libsdl.org/SDL_MixAudioFormat

donnierussellii commented 6 years ago

Yes, that function seems to help tremendously! Working on commits... Finished.