Re: Encoding Mono IMA4
Re: Encoding Mono IMA4
- Subject: Re: Encoding Mono IMA4
- From: William Stewart <email@hidden>
- Date: Mon, 31 Jul 2006 18:24:58 -0700
Shouldn't bytes per packet be a value dependent on your number of
channels - I like your other example better :-)
outputFormat.mBytesPerPacket = outputFormat.mChannelsPerFrame * 34;
BTW - We're really encouraging developers NOT to hard code values
like the below - so we provide a set of services from the AudioFormat
API that will fill out ASBD's for you. So, in this case you would set:
ima
numChannels
sampleRate
and set everything else to zero.
Then call the AudioFormatGetProperty call (the header lists the full
range) and have it fill out the rest of the fields for you (It would
also have saved you from this mistake too).
@constant kAudioFormatProperty_FormatInfo
Retrieves general information about a format. The specifier is a
magic cookie, or NULL.
On input, the property value is an AudioStreamBasicDescription
which
should have at least the mFormatID filled out. On output it will
be filled out
as much as possible given the information known about the format
and the contents of the magic cookie (if any is given).
Thanks
Bill
On 29/07/2006, at 11:13 AM, Lee Falin wrote:
Doh, found the problem.
The output format that I was passing to ExtAudioFileCreateNew was
correct, but the format that I was setting for
ExtAudioFileSetProperty for kExtAudioFileProperty_ClientDataFormat
had two channels instead of one. Apparently the converter can
convert between bitrates and encoding format, but not between mono
and stereo. (For example I write to file with a sampling rate of
11000, but my client format is 44100)
Here are the final settings I used for IMA4 mono:
AudioStreamBasicDescription outputFormat;
outputFormat.mChannelsPerFrame = 1;
outputFormat.mSampleRate = 11000;
outputFormat.mFormatID = kAudioFormatAppleIMA4;
outputFormat.mFormatFlags = 0;
outputFormat.mBitsPerChannel = 0;
outputFormat.mBytesPerFrame = 0;
outputFormat.mFramesPerPacket = 64;
outputFormat.mBytesPerPacket = 68;
Thanks for everyone's help,
Lee
_______________________________________________
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
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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