Re: Audio problem
Re: Audio problem
- Subject: Re: Audio problem
- From: "Sandeep Chandna" <email@hidden>
- Date: Tue, 20 Feb 2007 19:55:19 +0530
I tried to write a stand alone code to find the Minimum Number of packets required for any format using Audio converter but am facing some issues. Can you please point out whats going wrong here , I have never used Audio Converter APIs before.
AudioStreamBasicDescription asbd = {44100, 'QDM2', 0, 0 ,0 , 0, 2, 0, 0 };
UInt32 asbdSize = sizeof(asbd);
UInt32 minIPPackets,minOPPackets;
ComponentDescription cd = {kAudioEncoderComponentType,'QDM2'};
Component encoder = FindNextComponent(NULL,&cd);
//encoder is NULL in QDM2's/LPCM's case
ComponentInstance ci=OpenComponent(encoder);
AudioCodecSetProperty(ci,kAudioCodecPropertyCurrentOutputFormat,asbdSize,&asbd);
UInt32 packsize = 4;
AudioCodecGetProperty(ci,kAudioCodecPropertyMinimumNumberInputPackets,&packsize,&minIPPackets);
AudioCodecGetProperty(ci,kAudioCodecPropertyMinimumNumberOutputPackets,&packsize,&minOPPackets);
printf ("min input Packets %d, min output Packets %d\n",minIPPackets,minOPPackets);
When I replace QDM2 with IMA4 both the functions return 1 (4 for aac and samr). Are 1 and 4 correct value for IMA4 and AAC/AMR respectively, and am I missing something in LPCM/QDesign's case here?
On 12/02/07, Brad Ford <email@hidden> wrote:
QDesign audio packets are huge. There very likely isn't 50 packets
worth of source material if you're getting less than you asked for.
>
> Whereas if I set the number of packets to 5, the behaviour
> is undefined. Sometimes encoded file has full audio, at other times
> SCAudioFillBuffer keeps returning
> blank data endlessly and I have to forcibly terminate the
> loop. I am setting the endOfStream in the mySCAudioCallBack
> properly , is SCAudioFillBuffer broken for
> QDesign ? or am I missing something ?
This is a quirky behavior of QDesign. SCAudio doesn't expose a
property to ask the minimum number of packets required by a format,
but AudioConverter does, so you could verify this behavior by
substituting your SCAudioFillBuffer stuff with
AudioConverterFillComplexBuffer on an AudioConverter instance. I
believe QDesign requires a minimum of 10 packets.
-Brad Ford
QuickTime Engineering
_______________________________________________
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