Format convertion
Format convertion
- Subject: Format convertion
- From: "apple question" <email@hidden>
- Date: Fri, 30 Jun 2006 14:14:05 -0800
Hi,
I have a data stream of format KAudioFormatKLinearPCM collected from
iSight. How do I convert it to KAudioFormatALaw then convert it back to
KAudioFormatKLinearPCM ? I created a AudioConverter with input/output format
defined as:
inDataFormat.mFormatID = kAudioFormatALaw;
inDataFormat.mSampleRate = 48000.;
inDataFormat.mFormatFlags = kAudioFormatFlagIsPacked |
kAudioFormatFlagIsFloat | kAudioFormatFlagIsBigEndian;
inDataFormat.mBytesPerPacket = 4;
inDataFormat.mFramesPerPacket = 1;
inDataFormat.mBytesPerFrame = 4;
inDataFormat.mChannelsPerFrame = 1;
inDataFormat.mBitsPerChannel = 32;
outDataFormat = inDataFormat;
outDataFormat.mFormatID = kAudioFormatLinearPCM;
I have no problem convert the stream to KAudioFormatALaw, but when I try to
convert it back to Linear, it it crashes at AudioConverterFillComplexBuffer.
Am I doing something wrong? What is the right way to do it?
Thanks,
_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfee®
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
_______________________________________________
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