• 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
Detecting file completion of AUAudioFilePlayer playback
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Detecting file completion of AUAudioFilePlayer playback


  • Subject: Detecting file completion of AUAudioFilePlayer playback
  • From: Björn Kempen <email@hidden>
  • Date: Tue, 1 Dec 2009 09:59:07 +0100

Hi, I'm working on an app which uses an AUAudioFilePlayer audio unit
and I just can't seem to find a way to get a callback once the file
has finished playing.

Looking through the docs in AudioUnitProperties.h revealed something a
bit weird.

The docs first claim "The unit is a subclass of AUScheduledSoundPlayer
and inherits all of its "behavior.".
However, in the Completion Callbacks section, it seems like
mCompletionProc does something completely different.

AUScheduledSoundPlayer
    "To receive a callback when the slice has been played, store a
pointer to a callback function in the mCompletionProc field.
    This function will be called (from the audio unit's rendering
thread) when the slice has been completely
    played -- or when the slice is determined to be unplayable due to an error.
    As an alternative, you may also poll the slice's (mFlags &
kScheduledAudioSliceFlag_Complete)."

AUAudioFilePlayer
    "A region's completion callback (mCompletionProc) is called when
it has been completely scheduled for reading from disk.
   This callback is issued on the disk read thread."


In other words, it seems like the callback is called when the
scheduled sound of an AUScheduledSoundPlayer has finished playing, but
it will be called prior to that (since the scheduling will be
completed before the playback) for AUAudioFilePlayer.

My usage of mCompletionProc on an AUAudioFilePlayer confirms this,
which is sortof bad since I'd rather not have to resort to polling the
player to find out when the sound has finished playing.

Anyone has any ideas how to detect when playback has finished?

Thanks
- Björn Kempén
 _______________________________________________
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: Detecting file completion of AUAudioFilePlayer playback
      • From: Doug Wyatt <email@hidden>
  • Prev by Date: Re: Inconsistencies with large WAV file
  • Next by Date: Re: Inconsistencies with large WAV file
  • Previous by thread: Re: Inconsistencies with large WAV file
  • Next by thread: Re: Detecting file completion of AUAudioFilePlayer playback
  • Index(es):
    • Date
    • Thread