problem encoding in PCM format
problem encoding in PCM format
- Subject: problem encoding in PCM format
- From: "Sandeep Chandna" <email@hidden>
- Date: Tue, 31 Oct 2006 15:22:00 +0530
While encoding in PCM format I am facing problems in some configurations
-> 32 bit, little endian, floating point
I set the outputASBD as follows:
asbd.mFormatID = kAudioFormatLinearPCM;
asbd.mSampleRate = 32000.0;
asbd.mFormatFlags = kAudioFormatFlagIsFloat | kAudioFormatFlagIsPacked;
asbd.mBytesPerPacket = 8;
asbd.mFramesPerPacket = 1; // For PCM, frames per packet is always 1
asbd.mBytesPerFrame = 8; // for PCM, frames per packet and bytes per packet are equivalent
asbd.mChannelsPerFrame = 2;
asbd.mBitsPerChannel = 32;
asbd.mReserved = 0;
After the encoding completes, QTPro says that the file format is : 32 bit integer (big endian) and plays
some junk sound.
Similarly when I use the following:
asbd.mFormatID = kAudioFormatLinearPCM;
asbd.mSampleRate = 32000.0;
asbd.mFormatFlags = kAudioFormatFlagIsSignedInteger| kAudioFormatFlagIsPacked | kAudioFormatFlagIsBigEndian;
asbd.mBytesPerPacket = 4;
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;
asbd.mReserved = 0;
In this case encoding works fine (file plays in QTPro).
But If I remove the kAudioFormatFlagIsBigEndian from the FormatFlags above, leaving rest of the settings same the encoded file in QTPro shows the format as : 16 bit integer (big endian)
and plays some junk sound again.
If I do an export using QTpro to these formats the encoding happens properly with these settings, can someone
suggest what could possibly be going wrong ?
Also, other formats like IMA,Apple lossless are encoded properly. Problem is just with some PCMs
Thanks
Sandeep
_______________________________________________
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