Mac OS X : SDL_Mixer Playing MIDI and MP3 fil es at the incorrect speed

Hi All,
I’m using SDL_Mixer to play MIDI and mp3 files on Mac OS X. Users of my
application are reporting…
“32000 Hz WAV are played at half of actual speed, 8000 Hz WAV are played
at double actual speed and a 12000 Hz MP3 is not played at all.”

I’m initialising Mixer as follows…
Mix_OpenAudio( MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT,
MIX_DEFAULT_CHANNELS, 1024 );
And am using smpeg for mp3 support.

Thinking it would be ok, but obviously it isn’t ideal.

Is there a better way for me to handle the different types of audio file
formats correctly, so that they all play at the correct speed?

How are others handling the possibility of users throwing all manner of
sound formats at their application?

Thanks,

Dominique.

Any suggestions?

Thanks,

Dominique.

Hi All,
I’m using SDL_Mixer to play MIDI and mp3 files on Mac OS X. Users of
myOn Sun, 11 Jul 2010 19:24:29 -0400, <@dominique_at_savages> wrote:
application are reporting…
“32000 Hz WAV are played at half of actual speed, 8000 Hz WAV are played
at double actual speed and a 12000 Hz MP3 is not played at all.”

I’m initialising Mixer as follows…
Mix_OpenAudio( MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT,
MIX_DEFAULT_CHANNELS, 1024 );
And am using smpeg for mp3 support.

Thinking it would be ok, but obviously it isn’t ideal.

Is there a better way for me to handle the different types of audio file
formats correctly, so that they all play at the correct speed?

How are others handling the possibility of users throwing all manner of
sound formats at their application?

Hello,

I don’t have answers to this query, but I sure would like to see if anyone
does.

I recently noticed that MPlayer loads audio files and reports them at 44Khz
(typical for a music mp3) but reports the audio driver as 48Khz (the speed I
experimentally determined to be optimal for my audio hardware and,
presumably, most typical PC hardware).

How can one play something which is supposed to be played at a certain
sample rate, while making the driver believe that the sample rate is
another? Would it be something like filling blanks in the audio buffer every
so often so that the hardware runs at its preferred rate, but no extraneous
sounds get played?

Color me puzzled! (and eager to find an answer) If anyone has a different,
more audio-centric forum to suggest where these questions are better
presented, please mention it!

ChristianOn Thu, Jul 15, 2010 at 5:30 AM, wrote:

Any suggestions?

Thanks,

Dominique.

On Sun, 11 Jul 2010 19:24:29 -0400, wrote:

Hi All,
I’m using SDL_Mixer to play MIDI and mp3 files on Mac OS X. Users of
my
application are reporting…
“32000 Hz WAV are played at half of actual speed, 8000 Hz WAV are played
at double actual speed and a 12000 Hz MP3 is not played at all.”

I’m initialising Mixer as follows…
Mix_OpenAudio( MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT,
MIX_DEFAULT_CHANNELS, 1024 );
And am using smpeg for mp3 support.

Thinking it would be ok, but obviously it isn’t ideal.

Is there a better way for me to handle the different types of audio file
formats correctly, so that they all play at the correct speed?

How are others handling the possibility of users throwing all manner of
sound formats at their application?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org