I’m having a problem witth SDL_mixer.
When running FreeBSD, the sound plays with much less delay than with
Windows. I have searcht the list archives for this Problem, but only
found other people with the same problem, and no answers.
I am using the precompiled .dlls from the SDL website
(SDL-devel-1.2.6-mingw32.tar.gz, SDL_mixer-1.2.5a-win32.zip)
I have used the following simple test program to exclude any of my other
code as possible cause for the delay:
#include <stdio.h>
#include <stdlib.h>
#include “SDL.h”
#include “SDL_mixer.h”
Mix_Chunk *phaser = NULL;
void handleKey(SDL_KeyboardEvent key);
int main(int argc,char **argv){
SDL_Surface *screen;
SDL_Event event;
int done = 0;
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO);
if(Mix_OpenAudio(22050, AUDIO_S16, 2, 256)) {
printf(“Unable to open audio!\n”);
exit(1);
}
phaser = Mix_LoadWAV(“phaser.wav”);
screen = SDL_SetVideoMode(320, 240, 0, 0);
while(!done) {
while(SDL_PollEvent(&event)) {
switch(event.type) {
case SDL_QUIT:
done = 1; break;
case SDL_KEYDOWN:
Mix_PlayChannel(-1, phaser, 0); break;
}
}
}
Mix_CloseAudio();
SDL_Quit();
}
Can anyone help me with this problem?
CU,
Sec–
Error reduces
Your expensive computer
To a simple stone