Re: Efficient functions to convert 24 bit WAV audio into Float32
Re: Efficient functions to convert 24 bit WAV audio into Float32
- Subject: Re: Efficient functions to convert 24 bit WAV audio into Float32
- From: William Stewart <email@hidden>
- Date: Mon, 24 Oct 2005 11:28:56 -0700
Yes- the AudioConverter will suit your needs just fine I think.
You can use either the Fill or Convert API from this, it really
depends on what kind of buffer you are going to have to deal with
(AudioConverterFillComplexBuffer takes a buffer list,
AudioConverterConvertBuffer just takes a single buffer).
We've spent a good deal of time on optimising these conversion
routines, both on PPC and Intel CPUs, and of course for both endian
orders.
Bill
On 22/10/2005, at 12:30 PM, Steve Checkoway wrote:
On Oct 22, 2005, at 6:06 AM, Mark Gilbert wrote:
Folks.
We are optimizing our code, and we have got to a part of our
playback engine where we are feeding 24 bit Intel Format data into
an output device (requiring Float32).
Right now we have a function call which operates on each 24-bit
word. Clearly this is not efficient.
We have conjured up a macro for 16 bit to Float32, but its proving
tricky for 24 bit to Float32 (supporting both Moto and intel byte
ordering). Also, the macro is using some floating point division
which is apparently not efficient.
Is there some excellent function built into Core audio for these
conversions ?
We've been using AudioConverterConvertBuffer() for our audio
conversion needs. I'm not sure if it will convert from 24 bit (I
can only assume you mean little endian here) to float, however it
looks like you could clear the following flags:
kAudioFormatFlagIsFloat, kAudioFormatFlagIsBigEndian,
kAudioFormatFlagIsPacked, and kAudioFormatFlagIsAlignedHigh. Then,
if you specified 24 bits per channel, it looks like that should be
enough.
- Steve
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden