This is a patch for desmume-svn5030.
This patch adds the audio volume setting feature to the GTK user interface.
When it is applied, a new element appears in the menu bar: Config > Set audio volume.
From here, you can use a horizontal slider to set the audio volume between the 0 and 128 values.
Thanks, but isn't there somewhere else inside DeSmuME's code which sets volume without the frontend directly touching functions inside sndsdl.cpp?
Also, what should it do when the user has audio disabled?
SPU_SetVolume
I was not aware of the existence of the SPU_SetVolume function.
Indeed, it is probably better to use it to set the audio volume.
I have just hacked the source code of desmume-svn5030 to test the behavior of SPU_SetVolume.
Now, when I push the left control key, SPU_SetVolume(0) is called, and when I push the left shift key, SPU_SetVolume(100) is called.
But in the game, I do not hear any difference after pushing these keys.
Do you have any idea how to call correctly this function to set the volume?
When the user has audio disabled, the user can still set the audio volume from the menu.
But he will not hear audio because it is disabled.
It is the correct behavior, isn't it?
I see, turns out that
void SNDSDLSetVolume(int volume)
in sndsdl.cpp isn't implemented.It should work when you implement it.