Re: 24bit to 32 float
Re: 24bit to 32 float
- Subject: Re: 24bit to 32 float
- From: Autocat <email@hidden>
- Date: Tue, 4 Jun 2002 11:58:53 +0200
At 1:04 PM -0700 6/3/02, Paul Russell wrote:
Hi,
I would like to know what would be the best way to efficiently
convert audio samples from 24bit to 32 float, and vice versa, for
use in my OS X audio driver. Is anybody willing to share some code ?
If you don't mind being G4-specific and writing a few lines of
AltiVec code, then vec_ctf/vec_cts will do all the hard work for
you. You should be able to get around 1 sample per CPU clock
throughput (if the bus can handle it).
The AU expects a default range of +/-1.0 (where 1.0 is actually a clipped
value)
I'd recommend using the AudioConverter to do these conversions for you.
We've done even more work on them since 10.1, so with jaguar they are fast
and highly optimised for PPC, so I would expect them to be better than
generic code that runs on any number of platforms...
Thanks very much for this suggestion, I am looking into altivec
(although requiring a G4 is not exactely what I had in mind...)
I am also looking into using an AudioConverter, but it looks like
AudioConverter.h was designed to be compiled/used from a CoreAudio
app, not a IOKit driver.
If I do
#include <AudioToolbox/AudioConverter.h>
then I get the following errors:
/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudioTypes.h:21:32:
TargetConditionals.h: No such file or directory
/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudioTypes.h:27:30:
MacTypes.h: No such file or directory
/System/Library/Frameworks/CoreAudio.framework/Headers/CoreAudioTypes.h:38:
'Float64' is used as a type, but is not defined as a type.
I tried a number of things, but I have not been able to get it to
compile properly :-/
Thanks
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.