Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Format convertion



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:
http://lists.apple.com/mailman/options/coreaudio-api/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.