• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Efficient functions to convert 24 bit WAV audio into Float32
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Efficient functions to convert 24 bit WAV audio into Float32 (From: Mark Gilbert <email@hidden>)
 >Re: Efficient functions to convert 24 bit WAV audio into Float32 (From: Steve Checkoway <email@hidden>)

  • Prev by Date: Re: SoundConverterFillBuffer
  • Next by Date: Re: AudioFilePlayer & 4-channel wav file
  • Previous by thread: Re: Efficient functions to convert 24 bit WAV audio into Float32
  • Next by thread: Re: Efficient functions to convert 24 bit WAV audio into Float32
  • Index(es):
    • Date
    • Thread