Re: Converting from Float to Linear PCM
Re: Converting from Float to Linear PCM
- Subject: Re: Converting from Float to Linear PCM
- From: Jeff Moore <email@hidden>
- Date: Tue, 3 Jan 2006 14:45:11 -0800
On Jan 3, 2006, at 2:28 PM, Kevin Kicklighter wrote:
I'm using the ComplexPlayThru example code, but need linear PCM in
my application. Is there an easy way for me to do this or some
sample code I could look at somewhere?
I tried using the AUConverter, but seems counter-intuitive, since I
would have to implement another callback, when I'm already in the
InputProc callback.
To be clear, the floats you are getting _are_ linear PCM data. The
samples are just represented with a 32 bit floating point number
between -1 and 1.
I think what you mean is that you would like to convert the floats
into some kind of integer. You will want to use the AudioConverter
API for this
I also got the error : 1718449215 which I can't find anywhere.
Is there one place where the OSStatus's are defined? Also, does
anyone know error 560227702? I must be missing something basic b/c
I can't find these anywhere, even when I convert to hex.
These errors, like many errors from the various CoreAudio APIs, are 4
char codes:
1718449215 == 'fmt?' == kAudioConverterErr_FormatNotSupported which
is defined in <AudioToolbox/AudioConverter.h>
560227702 == '!dev' == kAudioHardwareBadDeviceError which is defined
in <CoreAudio/AudioHardware.h>
With Xcode 2.2, you can have the debugger show you the value of a
variable as a 4CC if you manually set the variable's type to OSType.
Short of that, you can write a gdb macro to do the chore. I have the
following in my .gdbinit file for doing this very thing:
define Print4CC
p (char[4])$arg0
end
--
Jeff Moore
Core Audio
Apple
_______________________________________________
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