• 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
fire callback after looping region completed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fire callback after looping region completed


  • Subject: fire callback after looping region completed
  • From: "Mazzaroth M." <email@hidden>
  • Date: Sun, 23 Nov 2014 16:55:50 -0500

I have this chunk of code in an audio unit which will play a region and loop it indefinitely:

    ScheduledAudioFileRegion rgn;
memset (&rgn.mTimeStamp, 0, sizeof(rgn.mTimeStamp));
rgn.mTimeStamp.mFlags = kAudioTimeStampSampleTimeValid;
rgn.mTimeStamp.mSampleTime = 0;
rgn.mCompletionProc = scheduledAudioSliceCompletionProc;
rgn.mCompletionProcUserData = NULL;
rgn.mAudioFile = player_->inputFile;
rgn.mLoopCount = -1;
rgn.mStartFrame = player_->startFrame;
rgn.mFramesToPlay = framesToPlay_;


I set the loop count to -1 to allow it to loop forever. I'm using this in a metronome. I would like to post a notification on each completion of the loop so that I can do something in the UI. scheduledAudioSliceCompletionProc will only get called when the playback stops for the entire graph, not on each completion of a loop.

Is there a way to find out when a loop finishes, so I can perform some action?

If I were to upgrade this code to 10.10, and use the new AVFoundations APIs, would I use 
scheduleSegment:startingFrame:frameCount:atTime:initWithSampleTime:completionHandler: ? I've attempted using that scheduling audio for a single second, but it did not seem to have an effect of playback(Xcode 6.1, Objc, yosemite).

thanks.
 _______________________________________________
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

  • Prev by Date: Re: Current version of AU Lab?
  • Next by Date: AudioReflectorDriver vs PhantomAudioDriver
  • Previous by thread: Re: Current version of AU Lab?
  • Next by thread: AudioReflectorDriver vs PhantomAudioDriver
  • Index(es):
    • Date
    • Thread