[SDL] Mix_VolumeMusic works for mp3/ogg, not for mod

Jerome Zago sdl-ml at agt-the-walker.net
Wed Nov 5 03:45:01 PST 2003


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




More information about the SDL mailing list