I just found a problem with the audio port for MacOSX.
This code works at least on Linux, Win32 and Amiga ports:
fmt.freq = samplerate; // it's 22050
fmt.format = AUDIO_S8;
fmt.samples = BUFFER_SIZE; // it's 4096
fmt.callback = handle_sound;
fmt.channels = 1;
fmt.userdata = NULL;
if (SDL_OpenAudio(&fmt, NULL) < 0) {
D(bug("Unable to open audio: %s\n", SDL_GetError()));
return FALSE;
}
I force a single channel with 8bit signed samples, leaving at the
underlying layer to convert a more suitable format if needed.
With OSX this line doesn’t give an error but the underlying layer fails
to convert the sample to a suitable format.
To make it works I’ve to specify an “obtained” format and convert my
samples to that one, the strange thing is that the obtained format is:
22050/AUDIO_U8/1/4096 while it seems that if I force the format with the
NULL in “obtained”, also the samplerate is not set to 22050…
Bye,
Gabry