• 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
Loop notification
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Loop notification


  • Subject: Loop notification
  • From: "Andreas Falkenhahn" <email@hidden>
  • Date: Tue, 16 Oct 2007 11:36:44 +0200 (CEST)
  • Importance: Normal

Hi,

how could I implement a loop notification in my double buffered audio file
player? I want to post an event to the main thread's event queue every
time an audio file is looped.

This does not seem to be as easy as it sounds, because the feeder thread
I'm employing for my double buffer reads the data from the stream (using
AudioFileReadPackets) in chunks of about 1 second's worth of audio data.
Thus, I can't simply send the loop notification when my feeder thread
detects the end of the stream and moves its cursor back to 0, because the
loop is not there yet. There's still audio left to be rendered.

I can't send the loop notification from the PreRender or PostRender events
either, because my ACFillComplexBuffer() callback is also called only in
intervals of about 1 second, which is too unprecise for a good loop
detection.

Could someone please point me in the direction I should take to implement
a precise loop notification feature? Of course, I could do it using a
hacky way, i.e. set flag on audio end detection in feeder thread, then on
the next PostRender notification calculate the remaining playing time
until loop, and then install a timer which fires after this remaining
playing time is up. But that doesn't look like a nice solution. Is there a
better one?

Tks

Andreas
 _______________________________________________
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: Loop notification
      • From: Mark Pauley <email@hidden>
  • Prev by Date: Re: there has somthing worry about CoreAudio
  • Next by Date: Re: AUSplitter and kAudioUnitSubType_Splitter
  • Previous by thread: Generic OUTGOING data to view?
  • Next by thread: Re: Loop notification
  • Index(es):
    • Date
    • Thread