[SDL] SDL_Mixer

David nesdavid at hotmail.com
Mon Jan 6 19:52:01 PST 2003


  ----- Original Message ----- 
  From: Rob 
  To: sdl at libsdl.org 
  Sent: Tuesday, January 07, 2003 12:44 AM
  Subject: Re: [SDL] SDL_Mixer


  Hmmm.
   
  Have you checked that SDL initialised the audio correctly, and that you've set the volue sample size, and so on?

yes i've check it.. here's the code... could it be some problem with the driver?

int main(int argc, char *argv[])
{
 Mix_Chunk *sonido;

 if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) {
  printf ("Error: %s\n", SDL_GetError());
  return 1;
 }

 if (Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 1, 2048) < 0) {
  printf ("Error: %s\n", Mix_GetError());
  return 1;
 } 

 atexit(SDL_Quit);
 atexit(Mix_CloseAudio);
 Mix_Volume(0,255);

 sonido = Mix_LoadWAV("Galaga.wav");
 if (!sonido) {
  printf ("Error: %s\n", Mix_GetError());
  return 1;
 }

 Mix_AllocateChannels(8);
 if (Mix_PlayChannel(-1, sonido, 0) < 0) {
  printf ("Error: %s\n", Mix_GetError());
  return 1;
 }

 while(Mix_Playing(-1)!= 0) ;

 Mix_FreeChunk(sonido);
 return 0;
}



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030106/704b3a89/attachment-0008.htm>


More information about the SDL mailing list