[SDL] Mix_VolumeMusic doesn't work properly

Jesse David Andrews jdandr2 at uky.edu
Wed Jan 22 09:32:01 PST 2003

What operating system?  I also have .it & .mod files working, but I cannot get the volume to change for .wav (haven't tried MP3).

I am on linux.


-----Original Message-----
From: enzogupi at interfree.it ()
To: sdl at libsdl.org
Date: 22 Jan 2003 13:17:32 -0000 
Subject: [SDL] Mix_VolumeMusic doesn't work properly

When I try to use Mix_VolumeMusic on mp3 files everithing goes ok.
When I replace mp3 with a "midi+sample" music file (ex. .it or .xm)
I obtain no effect.

You can try by yourself with this small program and the "music.it"
file included in SDL "aliens" demo.

Simply type:
   gcc -c testmusic.c
   gcc -o testmusic testmusic.o -lSDL -lSDL_mixer -lpthread

and you'll see that modifing the Mix_VolumeMusic value doesn't
change the result.

I don't think it's my fault 'cause it works with mp3 music.


--- file testmusic.c

#include <SDL/SDL.h>
#include <SDL/SDL_mixer.h>
char MusicName [] = "music.it";
Mix_Music* Music;
int main()
  if (SDL_Init (SDL_INIT_AUDIO) >= 0) {
    if (Mix_OpenAudio (44100,AUDIO_S16,1,8192) >= 0) {
      Music = Mix_LoadMUS (MusicName);
      Mix_VolumeMusic (50);
      if (Music) {
	Mix_PlayMusic (Music,0);
	while (Mix_PlayingMusic()) SDL_Delay (100);
	Mix_FreeMusic (Music);  
  return 0;


Salve, il messaggio che hai ricevuto
蠳tato inviato per mezzo del sistema
di web mail interfree. Se anche tu vuoi 
una casella di posta free visita il
sito http://club.interfree.it
Ti aspettiamo!


SDL mailing list
SDL at libsdl.org

More information about the SDL mailing list