Re: Converting to LPCM 32bit
Re: Converting to LPCM 32bit
- Subject: Re: Converting to LPCM 32bit
- From: Brad Ford <email@hidden>
- Date: Thu, 4 Jan 2007 08:29:44 -0800
Sandeep,
You don't specify how you are performing the audio conversion
(SoundConverter? AudioConverter? SCAudio?). You also don't specify
what your source format is. The data you're feeding the converter
might be in the wrong format. You also don't specify what you're
using to write your movie file. Perhaps the conversion is completely
correct, but the sample description you're building for the movie is
wrong, and therefore interpreted as big endian when the data is
really little endian. You can verify this for yourself by opening
one of the affected movies in Dumpster and altering the bits in the
audio sample description fields so that it specifies little endian
instead of big. If it plays correctly, then there's nothing wrong
with your conversion code -- it's just the part that builds the movie
track's sample description. By the way, 8 bit will always work for
you because there's no such thing as 8-bit big or little endian.
Endianness only comes into play when you've got words longer than 8
bits.
-Brad Ford
QuickTime Engineering
On Jan 3, 2007, at 11:27 PM, Sandeep Chandna wrote:
Hi,
I am converting audio to LPCM 32bit format using the
AudioStreamBasicDescription. For two cases it encodes fine (32 bit,
float, big endian and 32bit, integer, big endian) but for other two
cases (32 bit, float, little endian and 32bit, integer, little
endian) it encodes blank audio.
My ASBD looks like this:
asbd.mFormatID = kAudioFormatLinearPCM
asbd.mSampleRate = sampleRate;
asbd.mFormatFlags = kAudioFormatFlagIsPacked |
kAudioFormatFlagIsFloat ; // 32bit, float, little-endian - NOT
WORKING
/* and other cases as follows:
asbd.mFormatFlags = kAudioFormatFlagIsPacked |
kAudioFormatFlagIsSignedInteger; // 32bit, integer, little-endian
- NOT WORKING
asbd.mFormatFlags = kAudioFormatFlagIsPacked |
kAudioFormatFlagIsFloat | kAudioFormatFlagIsBigEndian ; // 32bit,
float, big-endian - WORKING
asbd.mFormatFlags = kAudioFormatFlagIsPacked |
kAudioFormatFlagIsBigEndian | kAudioFormatFlagIsSignedInteger; //
32bit, integer, big-endian - WORKING
*/
asbd.mBytesPerPacket = 4
asbd.mFramesPerPacket = 1;
asbd.mBytesPerFrame = 4
asbd.mChannelsPerFrame = 1
asbd.mBitsPerChannel = 32
asbd.mReserved = 0;
Moreover, when I open the faulty encoded files in quicktime
and see Movie Info, it shows '32 bit Float (Big endian)', '32 bit
Integer (Big endian)' . Am I setting the formatFlags properly? how
do i encode LPCM little endian ?
Also, Using the above formatFlags, I am able to encode in
8bit, little endian formats . The problem is only in 32 and 24 bits.
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
_______________________________________________
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