Mix_VolumeMusic works for mp3/ogg, not for mod

Two configurations give the same result :

  • SDL Mixer 1.2.4 shipped with my distribution, Mandrake Linux 9.1
  • SDL Mixer 1.2.5, built from scratch

Here is the test case :-----
$ cat testmusic.c
#include <SDL/SDL.h>
#include <SDL/SDL_mixer.h>

int main(int argc, char argv)
{
if (SDL_Init (SDL_INIT_AUDIO) >= 0) {
if (Mix_OpenAudio (44100,AUDIO_S16,1,8192) >= 0) {
Mix_Music
Music = Mix_LoadMUS (argv[1]);
if (Music) {
Mix_VolumeMusic (0); /
<------ */
Mix_PlayMusic (Music,0);
printf (“Now playing\n”);
SDL_Delay(15000);
Mix_FreeMusic (Music);
}
}
}
SDL_Quit();
return 0;
};

$ make
cc -g -O2 -Wall -I/usr/include/SDL -D_REENTRANT -L/usr/lib -lSDL -lpthread
-lSDL_mixer testmusic.c -o testmusic

$ ./testmusic ~/Documents/mp3/free/JazzWare/Speed.mp3
Now playing
[ I hear nothing as expected ]

$ ./testmusic ~/Documents/mp3/free/Talks/discours-loic-autrans2003.ogg
Now playing
[ I hear nothing as expected ]

./testmusic /usr/local/share/heroes/mod/heroes01.xm
Now playing
[ I hear the module ! This wasn’t expected ! ]

Can anyone out there reproduce that behaviour ? Is it a bug or a feature ?
More details upon request. Thanks for your time.


Fingerprint: 8741 62F1 586D D440 C5CA D1CA CBE5 669A 7EA5 D9F9

Hello Jerome,

Two configurations give the same result :

  • SDL Mixer 1.2.4 shipped with my distribution, Mandrake Linux 9.1
  • SDL Mixer 1.2.5, built from scratch

Here is the test case :
[…]
Mix_VolumeMusic (0); /* <------ */
Mix_PlayMusic (Music,0);
[…]
Can anyone out there reproduce that behaviour ? Is it a bug or a feature ?

Yes, I had exactly the same problem. In my game “Rocks’n’Diamonds”,
it therefore looks like the following:

[…]
/* Mix_VolumeMusic() must be called after Mix_PlayMusic() –
this looks like a bug in the SDL_mixer library */
Mix_PlayMusic(mixer[audio.music_channel].data_ptr, -1);
Mix_VolumeMusic(SOUND_MAX_VOLUME);
[…]

This seems to be a bug in SDL_mixer! I think this was already reported
to the list by somebody some time ago.

If not: Can anyone of the SDL_mixer maintainers comment on this? Ryan?

Best regards,
Holger–
holger.schemel at telefonica.de

“Perl - the only language that looks the same before and after RSA encryption.”

This SDL_mixer bug has been fixed in CVS. For details :
http://www.libsdl.org/cgi/cvsweb.cgi/SDL_mixer/music.c.diff?r1=1.52&r2=1.53
http://www.libsdl.org/cgi/cvsweb.cgi/SDL_mixer/music.c?rev=1.53&content-type=text/x-cvsweb-markup

Note to SDL_mixer maintainers : this bugfix should probably get a line in
"CHANGES" (1.2.6 section).On Monday 24 November 2003 18:25, Holger Schemel wrote:

Yes, I had exactly the same problem. In my game “Rocks’n’Diamonds”,
it therefore looks like the following:

[…]

This seems to be a bug in SDL_mixer! I think this was already reported
to the list by somebody some time ago.

This seems to be a bug in SDL_mixer! I think this was already reported
to the list by somebody some time ago.

If not: Can anyone of the SDL_mixer maintainers comment on this? Ryan?

I thought we put a fix in CVS for this…if we did, there hasn’t been an
official release since then.

–ryan.