Re: Converting to LPCM 32bit
Re: Converting to LPCM 32bit
- Subject: Re: Converting to LPCM 32bit
- From: "Sandeep Chandna" <email@hidden>
- Date: Fri, 5 Jan 2007 13:55:45 +0530
Brad,
Thanks for the response.
I am using SCAudio for conversion. In Dumpster I could find the SampleDescription->dataFormat in the two cases as
'in32' and 'fl32' which as far as i know means integer,32,big endian and float,32,big endian (correct me if i am wrong).
I could not find any corresponding dataFormats for Little Endian for 32 bit formats as available for 16 bit case - 'sowt' . Is there any other setting in the
dumpster output that changes bigEndian to littleEndian?
Also, I am using QTSoundDescriptionCreate to create the SDH, and output ASBD is defined as given in my last mail (qouted here).
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;
QTSoundDescriptionCreate( &asbd, pLayout, layoutSize, NULL, 0,
kQTSoundDescriptionKind_Movie_LowestPossibleVersion,
&sdh);
My input format in the both 32 bit cases is as follows:
iasbd.mFormatID = kAudioFormatLinearPCM;
iasbd.mSampleRate = sampleRate;
iasbd.mFormatFlags = kAudioFormatFlagIsSignedInteger| kAudioFormatFlagIsPacked | kAudioFormatFlagsNativeEndian; // LPCM, 32bit, signed , native endian
iasbd.mBytesPerPacket = 4; // for 32bit, 3 for 24
iasbd.mFramesPerPacket
= 1;
iasbd.mBytesPerFrame = 4; //for 32bit, 3 for 24
iasbd.mChannelsPerFrame = 1;
iasbd.mBitsPerChannel = 32; //for 32 bit, 24 for 24bit case
iasbd.mReserved = 0;
Am I initializing the input ASBD (isabd) wrongly? or do I need to initialize the sound description in some other manner. My input is always LPCM, signed, native endian.
Thanks
Sandeep
On 04/01/07, Brad Ford <email@hidden> wrote:
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,
>
_______________________________________________
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