Im using the version of SDL_Mixer that came with the HW accellerated SDL, and randomly, the sound disappears, and its also very quiet, even when I have the volume up the SDL_Mixer's Max, 128. Mix_GetError() doesnt return anything.
Im loading my music file like this
CODE
music[0] = Mix_LoadMUS("music1.ogg");
and initiallizing SDL_Mixer like this:CODE
Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, AUDIO_S16, MIX_DEFAULT_CHANNELS, 128);
Ive also tried
CODE
Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, AUDIO_S16, MIX_DEFAULT_CHANNELS, 256);
I initialize SDL like this:CODE
SDL_Init( SDL_INIT_JOYSTICK | SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER);
SDL_WM_SetCaption( "Bloxz", 0 );
screen=SDL_SetVideoMode(320,240,16,SDL_HWSURFACE | SDL_DOUBLEBUF);
Enable940();
joy=SDL_JoystickOpen(0);
TTF_Init();
font = TTF_OpenFont("font.ttf", 12);
SDL_ShowCursor(SDL_DISABLE);
And I play music like this: CODE
Mix_HaltMusic();
Mix_PlayMusic(music[rand()%musnum], -1);
I play my single sound effect like this:CODE
Mix_HaltChannel(channel);
channel=Mix_PlayChannel(-1,bomb,0);
Also, the screen sometimes flickers when I play the sound effect.
What am I doing wrong?
Im loading my music file like this
CODE
music[0] = Mix_LoadMUS("music1.ogg");
and initiallizing SDL_Mixer like this:CODE
Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, AUDIO_S16, MIX_DEFAULT_CHANNELS, 128);
Ive also tried
CODE
Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, AUDIO_S16, MIX_DEFAULT_CHANNELS, 256);
I initialize SDL like this:CODE
SDL_Init( SDL_INIT_JOYSTICK | SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER);
SDL_WM_SetCaption( "Bloxz", 0 );
screen=SDL_SetVideoMode(320,240,16,SDL_HWSURFACE | SDL_DOUBLEBUF);
Enable940();
joy=SDL_JoystickOpen(0);
TTF_Init();
font = TTF_OpenFont("font.ttf", 12);
SDL_ShowCursor(SDL_DISABLE);
And I play music like this: CODE
Mix_HaltMusic();
Mix_PlayMusic(music[rand()%musnum], -1);
I play my single sound effect like this:CODE
Mix_HaltChannel(channel);
channel=Mix_PlayChannel(-1,bomb,0);
Also, the screen sometimes flickers when I play the sound effect.
What am I doing wrong?