Re : Mac OS X : SDL_Mixer Playing MIDI and MP3 files at the incorrect speed

Hi all,
I’m bumping this thread again as I still have not found a solution to my
original issue.
So has anyone else come across Christian and mine’s issue?

At the moment I’m in the process of trying to get to grips with using
Apple’s AudioToolBox and AudioUnit instead of SDL_Mixer
and what can I say, it is a very very painful process.

Any suggestions/ideas?

Thanks,

Dominique.

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!

Christian

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> On Fri Jul 16 10:18:39 PDT 2010, Christian Leger<chrism.leger at gmail.com> wrote:
On Sun, 11 Jul 2010 19:24:29 -0400, <@dominique_at_savages> wrote:

sound formats at their application?