Sound Volume Issues in SDL_Mixer on Windows Vista / 7

I'm not very good at C ++ or SDL_Mixer, but I still ask this question on behalf of the Doom community. Simply put, no one who writes Doom source sources can figure out how to independently adjust the normal volume level and MIDI sound volume independently of SDL_Mixer in Windows Vista or 7. I will let James Haley, author of the Eternity Engine, put it in his own words

It seems that the concept of independent volume for native MIDI does not exist in Windows Vista or 7, since using the sliders of a MIDI volume in any application in which they are (including most games using SDL_mixer) also affects the volume of digital sound. This makes an attempt to adjust the relative volume of music for convenience impossible.

Has anyone found any workarounds for this? I suppose this is unlikely, given how Microsoft seems to have combined the entire OS to control the volume of individual audio devices individually.

I have heard of various workarounds related to the Timidity driver, but this requires that the user go beyond simply installing the game on his system. The only port I know of that finally fixes this problem is ZDoom, but it uses a GPL-incompatible FModEx and therefore is not a suitable solution.

If you need some code to view, Chocolate Doom is probably the easiest port for a Doom source, and you can grab its source here .

Any suggestions for other open source sound and music libraries are also welcome.

+6
source share
4 answers

The solution would be to deliver using SDL_mixer with FluidSynth support. You will also need to send a SoundFont2 file to go with it. Fortunately, there is free SF2 there, and some are even optimized for Doom MIDI files. Licenses should not be a problem, because SoundFonts are assets, not code.

Then you load SF2 with Mix_SetSoundFonts ().

+1
source
0
source

I support a similar game port (Descent 2), and I ran into the same problem. Afaik there is no solution for this when using SDL_mixer. The avoidance of avoiding mute when muting MIDI music that I discovered is to get the handle of the temporary MIDI device, set the midi volume to max, and then close the temporary device again.

0
source

For the longest time, the only solution we found was to use something like PortMIDI. However, the fame of the Quasar of Eternity Engine met a neat solution:

http://www.doomworld.com/vb/showthread.php?s=&postid=1124981#post1124981

It essentially puts SDL_Mixer in its own process and manages it using RPC. Very smart.

0
source

Source: https://habr.com/ru/post/887160/


All Articles