• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Audio problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Audio problem
      • From: William Stewart <email@hidden>
References: 
 >Audio problem (From: "Sandeep Chandna" <email@hidden>)
 >Re: Audio problem (From: Brad Ford <email@hidden>)

  • Prev by Date: Performance differences between AudioFileWritePackets() and FSWriteFork()
  • Next by Date: Re: Calibration of pitch bend in DLSSynth?
  • Previous by thread: Re: Audio problem
  • Next by thread: Re: Audio problem
  • Index(es):
    • Date
    • Thread