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.

Thanks,
Enzo.

— 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);
}
}
}
SDL_Quit();
return 0;
};-----------------------------------------------------

Salve, il messaggio che hai ricevuto
? stato 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!


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.

Jesse> ----- Original Message -----

From: enzogupi@interfree.it (Enzo)
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.

Thanks,
Enzo.

— 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);
}
}
}
SDL_Quit();
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
http://www.libsdl.org/mailman/listinfo/sdl

Have you tried Mix_Volume or Mix_VolumeChunk?On Wed, 2003-01-22 at 11:30, Jesse David Andrews wrote:

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.

Jesse

-----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.

Thanks,
Enzo.

— 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);
}
}
}
SDL_Quit();
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
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Mix_Volume’s prototype is:
int Mix_Volume(int channel, int volume)

Even if you do Mix_Volume(-1, MIX_MAX_VOLUME/4);
the music will still be full volume.

Mix_VolumeChunk’s prototype is:
int Mix_VolumeChunk(Mix_Chunk *chunk, int volume)

and Mix_LoadMUS(“filename.wav”) returns a Mix_music *, not a Mix_Chunk.

but Mix_music is a structure with pointers to (like Mix_music->wave or Mix_music->mp3, depending on what Mix_music->type is…), that we may be able to use…

But that isn’t the point, if it is just a matter of manually going to the root of the data source and setting the volume, why not just set it via the Mix_VolumeMusic command with the code there?

Should it have worked before, and this is just a bug that cropped in?

Jesse> ----- Original Message -----

From: robert@littlebitlost.com (Robert Diel)
To: sdl at libsdl.org
Date: 22 Jan 2003 13:44:14 -0600
Subject: Re: [SDL] Mix_VolumeMusic doesn’t work properly

Have you tried Mix_Volume or Mix_VolumeChunk?

On Wed, 2003-01-22 at 11:30, Jesse David Andrews wrote:

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.

Jesse

-----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.

Thanks,
Enzo.

— 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);
}
}
}
SDL_Quit();
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
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

ok, I dug around the source, and here is the problem:

from wavstream.c:

/* Unimplemented */
extern void WAVStream_SetVolume(int volume)
{
}> ----- Original Message -----

From: robert@littlebitlost.com (Robert Diel)
To: sdl at libsdl.org
Date: 22 Jan 2003 13:44:14 -0600
Subject: Re: [SDL] Mix_VolumeMusic doesn’t work properly

Have you tried Mix_Volume or Mix_VolumeChunk?

On Wed, 2003-01-22 at 11:30, Jesse David Andrews wrote:

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.

Jesse

-----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.

Thanks,
Enzo.

— 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);
}
}
}
SDL_Quit();
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
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Have u tried using Mix_Chunk instead of Mix_Music. The following taken from
SDL_mixer.h indicates the use of Mix_LoadWAV() or Mix_LoadWAV_RW() for the
type of data your describing. Line 115 indicates that Mix_LoadWAV() is
essentially the same as Mix_LoadWAV_RW only with a couple extra parameters
ie “rb” and 1 thus Mix_LoadWAV() should be enough. Change the volume via
Mix_VolumeChunk() or directly from the Mix_Chunk struct eg

Mix_Chunk *chunk;
chunk->volume = 100;

SDL_mixer.h
00113 /* Load a wave file or a music (.mod .s3m .it .xm) file */
00114 extern DECLSPEC Mix_Chunk *Mix_LoadWAV_RW(SDL_RWops *src, int
freesrc);
00115 #define Mix_LoadWAV(file) Mix_LoadWAV_RW(SDL_RWFromFile(file,
“rb”),1)>From: “Jesse David Andrews”

Reply-To: sdl at libsdl.org
To: sdl at libsdl.org
Subject: Re: Re: [SDL] Mix_VolumeMusic doesn’t work properly
Date: Wed, 22 Jan 2003 15:21:21 -0500

ok, I dug around the source, and here is the problem:

from wavstream.c:

/* Unimplemented */
extern void WAVStream_SetVolume(int volume)
{
}

-----Original Message-----
From: Robert Diel
To: sdl at libsdl.org
Date: 22 Jan 2003 13:44:14 -0600
Subject: Re: [SDL] Mix_VolumeMusic doesn’t work properly

Have you tried Mix_Volume or Mix_VolumeChunk?

On Wed, 2003-01-22 at 11:30, Jesse David Andrews wrote:

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.

Jesse

-----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.

Thanks,
Enzo.

— 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);
}
}
}
SDL_Quit();
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
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail

Sorry about that last message, i missed line 116 in there indicating the use
of Mix_Music to play (.mod .s3m .it .xm) file. Dont use Mix_Chunk :)>From: “P. M.” <@P_M>

Reply-To: sdl at libsdl.org
To: sdl at libsdl.org
Subject: Re: Re: [SDL] Mix_VolumeMusic doesn’t work properly
Date: Thu, 23 Jan 2003 03:13:42 +0000

Have u tried using Mix_Chunk instead of Mix_Music. The following taken from
SDL_mixer.h indicates the use of Mix_LoadWAV() or Mix_LoadWAV_RW() for the
type of data your describing. Line 115 indicates that Mix_LoadWAV() is
essentially the same as Mix_LoadWAV_RW only with a couple extra parameters
ie “rb” and 1 thus Mix_LoadWAV() should be enough. Change the volume via
Mix_VolumeChunk() or directly from the Mix_Chunk struct eg

Mix_Chunk *chunk;
chunk->volume = 100;

SDL_mixer.h
00113 /* Load a wave file or a music (.mod .s3m .it .xm) file */
00114 extern DECLSPEC Mix_Chunk *Mix_LoadWAV_RW(SDL_RWops *src, int
freesrc);
00115 #define Mix_LoadWAV(file) Mix_LoadWAV_RW(SDL_RWFromFile(file,
“rb”),1)

From: “Jesse David Andrews”
Reply-To: sdl at libsdl.org
To: sdl at libsdl.org
Subject: Re: Re: [SDL] Mix_VolumeMusic doesn’t work properly
Date: Wed, 22 Jan 2003 15:21:21 -0500

ok, I dug around the source, and here is the problem:

from wavstream.c:

/* Unimplemented */
extern void WAVStream_SetVolume(int volume)
{
}

-----Original Message-----
From: Robert Diel
To: sdl at libsdl.org
Date: 22 Jan 2003 13:44:14 -0600
Subject: Re: [SDL] Mix_VolumeMusic doesn’t work properly

Have you tried Mix_Volume or Mix_VolumeChunk?

On Wed, 2003-01-22 at 11:30, Jesse David Andrews wrote:

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.

Jesse

-----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.

Thanks,
Enzo.

— 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);
}
}
}
SDL_Quit();
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
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus

I am thinking about diving into the mixer code and trying to create a patch…

It scares me that it hasn’t been done yet. Makes me think that there must be MANY issues with it, and it isn’t trival at all and is weeks and weeks of work . . .

Jesse> ----- Original Message -----

From: polymorphic_messiah@hotmail.com (P. M.)
To: sdl at libsdl.org
Date: Thu, 23 Jan 2003 03:41:58 +0000
Subject: Re: Re: [SDL] Mix_VolumeMusic doesn’t work properly

Sorry about that last message, i missed line 116 in there indicating the use
of Mix_Music to play (.mod .s3m .it .xm) file. Dont use Mix_Chunk :slight_smile:

From: “P. M.” <polymorphic_messiah at hotmail.com>
Reply-To: sdl at libsdl.org
To: sdl at libsdl.org
Subject: Re: Re: [SDL] Mix_VolumeMusic doesn’t work properly
Date: Thu, 23 Jan 2003 03:13:42 +0000

Have u tried using Mix_Chunk instead of Mix_Music. The following taken from
SDL_mixer.h indicates the use of Mix_LoadWAV() or Mix_LoadWAV_RW() for the
type of data your describing. Line 115 indicates that Mix_LoadWAV() is
essentially the same as Mix_LoadWAV_RW only with a couple extra parameters
ie “rb” and 1 thus Mix_LoadWAV() should be enough. Change the volume via
Mix_VolumeChunk() or directly from the Mix_Chunk struct eg

Mix_Chunk *chunk;
chunk->volume = 100;

SDL_mixer.h
00113 /* Load a wave file or a music (.mod .s3m .it .xm) file */
00114 extern DECLSPEC Mix_Chunk *Mix_LoadWAV_RW(SDL_RWops *src, int
freesrc);
00115 #define Mix_LoadWAV(file) Mix_LoadWAV_RW(SDL_RWFromFile(file,
“rb”),1)

From: “Jesse David Andrews” <@Jesse_David_Andrews>
Reply-To: sdl at libsdl.org
To: sdl at libsdl.org
Subject: Re: Re: [SDL] Mix_VolumeMusic doesn’t work properly
Date: Wed, 22 Jan 2003 15:21:21 -0500

ok, I dug around the source, and here is the problem:

from wavstream.c:

/* Unimplemented */
extern void WAVStream_SetVolume(int volume)
{
}

-----Original Message-----
From: Robert Diel
To: sdl at libsdl.org
Date: 22 Jan 2003 13:44:14 -0600
Subject: Re: [SDL] Mix_VolumeMusic doesn’t work properly

Have you tried Mix_Volume or Mix_VolumeChunk?

On Wed, 2003-01-22 at 11:30, Jesse David Andrews wrote:

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.

Jesse

-----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.

Thanks,
Enzo.

— 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);
}
}
}
SDL_Quit();
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
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

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.

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

Hi Enzo,

I ran into the same problem, and since at the time my internet service
was down, I dug into it and fixed it my self. Although you got many
responses about Mix_Volume and Mix_VolumeChunk, these don’t seem to
have anything to do with the tracker style music playback (as you
noted, mp3 volume control works perfectly).

The problem seems to be in MikMod. As far as I could tell, MikMod
is overriding the volume you request with the volume encoded into the
song for each note of the track. Here is my patch, which scales
sample to the volume you request after all the volume effects from the
track have been applied:

— mplayer.c 2001-12-19 09:11:40.000000000 -0800
+++ mplayer.c.new 2003-02-10 11:39:49.000000000 -0800
@@ -1939,6 +1939,8 @@
tmpvol*=envvol; /* * max 256 /
tmpvol
=pf->volume; /* * max 128 */
tmpvol/=4194304UL;

  •           tmpvol*=pf->initvolume;   /* * max 128 */
    
  •           tmpvol/=128;
    
              /* fade out */
              if (pf->sngpos>=pf->numpos) tmpvol=0;
    

Hope that helps,
Ben> From: enzogupi at interfree.it ()

Date: 22 Jan 2003 13:17:32 -0000


Ben Nason
"Until a man is twenty-five, he still thinks, every so often, that under
the right circumstances he could be the baddest mf in the
world." - Neal Stephenson, “Snow Crash”

Here is my patch, which scales sample to the volume you request
after all the volume effects from the track have been applied:

Hope that helps,
Ben

Thanks much!
Tomorrow (not now, in Italy is night) I will try it and you’ll
know if it works for me too.

Enzo.

I ran into the same problem, and since at the time my internet service
was down, I dug into it and fixed it my self. Although you got many
responses about Mix_Volume and Mix_VolumeChunk, these don’t seem to
have anything to do with the tracker style music playback (as you
noted, mp3 volume control works perfectly).

The problem seems to be in MikMod. As far as I could tell, MikMod
is overriding the volume you request with the volume encoded into the
song for each note of the track. Here is my patch, which scales
sample to the volume you request after all the volume effects from the
track have been applied:

Thanks! Your patch has been added to CVS.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

I am thinking about diving into the mixer code and trying to create a patch…
I’m working on it now. I’ll test it and add it to the next SDL_mixer release.

It scares me that it hasn’t been done yet. Makes me think that there must be MANY issues with it, and it isn’t trival at all and is weeks and weeks of work . . .

No, I was just lazy and didn’t implement it. :slight_smile: It’s just a matter of changing
the memcpy to SDL_MixAudio().

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment