Mailing Lists: Apple Mailing Lists

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

doubts in encoding from raw data



Hi

I have to encode raw PCM data (input) in some specific format for eg Apple lossless ('alac') (output) using scaudiofillbuffer API can someone help me in this regard.

My doubts are as follows:
- How do I set the AudioStreamBasicDescription for the input? I tried to set some default values (like given below) but when I do QTSetComponentProperty with the 'asbd' it returns me -206.

asbd.mFormatID = kAudioFormatLinearPCM;
asbd.mSampleRate = 44100.0;  // or whatever the sample rate is
asbd.mFormatFlags = kAudioFormatFlagIsBigEndian | kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked;
asbd.mBytesPerPacket = 4; // 16-bit * 2 channels
asbd.mFramesPerPacket = 1; // For PCM, frames per packet is always 1
asbd.mBytesPerFrame = 4; // for PCM, frames per packet and bytes per packet are equivalent
asbd.mChannelsPerFrame = 2;
asbd.mBitsPerChannel = 16;



- and, What exactly should the callback SCAudioInputDataProc (callback passed to scaudiofillbuffer) do?

Can anyone outline the whole procedure for the same as I have been trying different things with the API/scaudiocompress and not reaching anywhere.

Thanks
Sandeep
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-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.