• 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: Contradiction in the core audio queue services API
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Contradiction in the core audio queue services API


  • Subject: Re: Contradiction in the core audio queue services API
  • From: William Stewart <email@hidden>
  • Date: Tue, 20 Oct 2009 16:10:05 -0700

That language could be better - I have corrected the comment below


On Oct 20, 2009, at 10:16 AM, Stephen Thomas wrote:

Hi,

In the following document,
http://developer.apple.com/mac/library/documentation/MusicAudio/Reference/AudioQueueReference/Reference/reference.html

There is a contradiction(Contradiction is highlighted in red color). In the parameter list of AudioQueueNewOutput, it is mentioned that, callback will get called after the buffer is played.
But in the description of AudioQueueOutputCallback, it is contradicted.


Which is true in this case?

AudioQueueNewOutput

Creates a new playback audio queue object.

OSStatus AudioQueueNewOutput (

   const AudioStreamBasicDescription   *inFormat,



   AudioQueueOutputCallback            inCallbackProc,



   void                                *inUserData,
   CFRunLoopRef                        inCallbackRunLoop,



   CFStringRef                         inCallbackRunLoopMode,



   UInt32                              inFlags,
   AudioQueueRef                       *outAQ



);
Parameters

inCallbackProc
A callback function to use with the playback audio queue. The audio queue calls this function when the audio queue has finished playing a buffer. See AudioQueueOutputCallback.



when the audio queue has finished processing a buffer.


-------------------------------------------------------------------

AudioQueueOutputCallback

Defines a pointer to a callback function that is called when an audio queue buffer is available for reuse.

typedef void (*AudioQueueOutputCallback) (
   void                 *inUserData,


AudioQueueRef inAQ,



   AudioQueueBufferRef  inBuffer
);
Discussion

When your application receives a call to the AudioQueueOutputCallback function, you cannot assume that the audio data from the newly-available buffer has been played. To ensure that all queued audio has finished playing, use the AudioQueuePropertyListenerProc property listener callback function, set to listen to the kAudioQueueProperty_IsRunning property.

this is very misleading. The only time this is relevant is if you have done an AudioQueueStop (queue, false) call - which is that the queue will top when it has played all of the currently enqueued buffers


Otherwise, there is no way to determine when an audio queue has actually played all of the data (except of course that you can calculate this by looking at the time stamps of the queue and you know how much data you actually enqueued) - that is, there is no callback to tell you this state.

Bill

_______________________________________________
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


References: 
 >Contradiction in the core audio queue services API (From: Stephen Thomas <email@hidden>)

  • Prev by Date: Correct Key for MIDI Source
  • Next by Date: Re: AudioUnitRender returning -10863 if no input device is present
  • Previous by thread: Contradiction in the core audio queue services API
  • Next by thread: Correct Key for MIDI Source
  • Index(es):
    • Date
    • Thread