Need some help

SDL_mixer “Mix_PlayMusic” crash issue, need some help…------------------------------------------------------------------------------

Mix_Music *MusicTrack[MusicTotal];
int MusicVolume;

Mix_Chunk *SoundFX[SoundTotal];
int SoundVolume;


void Audio::LoadMusic(void)
{
MusicTrack[0] = Mix_LoadMUS(“Music/Music_Track_1.MP3”);
if(!MusicTrack[0])
{
fprintf(stderr, “Couldn’t load %s: %s\n”, “Music/Music_Track_1.MP3”,
Mix_GetError());
}
//----------------------------------------------------------------------------

MusicTrack[1] = Mix_LoadMUS(“Music/Music_Track_2.MP3”);
if(!MusicTrack[1])
{
fprintf(stderr, “Couldn’t load %s: %s\n”, “Music/Music_Track_2.MP3”,
Mix_GetError());
}
//----------------------------------------------------------------------------

MusicTrack[2] = Mix_LoadMUS(“Music/Music_Track_3.MP3”);
if(!MusicTrack[2])
{
fprintf(stderr, “Couldn’t load %s: %s\n”, “Music/Music_Track_3.MP3”,
Mix_GetError());
}
//----------------------------------------------------------------------------

MusicTrack[3] = Mix_LoadMUS(“Music/Music_Track_4.MP3”);
if(!MusicTrack[3])
{
fprintf(stderr, “Couldn’t load %s: %s\n”, “Music/Music_Track_4.MP3”,
Mix_GetError());
}
//----------------------------------------------------------------------------

MusicTrack[4] = Mix_LoadMUS(“Music/Music_Track_5.MP3”);
if(!MusicTrack[4])
{
fprintf(stderr, “Couldn’t load %s: %s\n”, “Music/Music_Track_4.MP3”,
Mix_GetError());
}
//----------------------------------------------------------------------------

Mix_VolumeMusic(MusicVolume);


void Audio::PlayMusic(Uint8 musicIndex)
{
if (Mix_PlayingMusic() == 1) Mix_HaltMusic();
SDL_Delay(1000);

  Mix_VolumeMusic(MusicVolume);

  if(Mix_PlayMusic(MusicTrack[musicIndex],  -1)==-1)

{
printf(“Mix_PlayMusic: %s\n”, Mix_GetError());
}
}


Problem:
Sometimes application crashes (perhaps 1 out of 30 times)
when “Mix_PlayMusic” is executed in above function class.

Anyone with ideas ?

Jesse
SLNTHERO at AOL.com (mailto:SLNTHERO at AOL.com)
www.SilentHeroProductions.com (http://www.silentheroproductions.com/)

Why not give someone a chance to answer the same question you posted
three hours ago? There’s no difference in the text and posting twice
isn’t going to make anyone more knowledgeable. Not everyone is sitting
at home reading this list.–
Lilith

On 9/6/2006 at 6:22 PM, in message <c51.1e4ae26.3230b237 at aol.com>, wrote:

SDL_mixer “Mix_PlayMusic” crash issue, need some help…

Please stop spamming the list by posting the same question several
times. You are only going to make people less interested in answering
you.–

  • SR

Hello SlntHero,

Thursday, September 7, 2006, 12:22:31 AM, you wrote:

SDL_mixer “Mix_PlayMusic” crash issue, need some help…

You have asked this before a few times. It’s been established that
there must be some kind of bug in newer builds of SDL_mixer with
SMPEG. The solution is to switch to Vorbis which works.

The problem is filed in Bugzilla and will be looked at when ryan can
do it. Unless you can provide more info (such as exactly where it
crashes inside SDL_mixer or SMPEG), it is not going to get resolved
any quicker.

As others have said, multiple posting about the issue is only going to
annoy people.–
Best regards,
Peter mailto:@Peter_Mulholland