• 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
how to know when AudioGraph as finished? ( I.E. the last sample has been rendered by kAudioUnitSubType_RemoteIO?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to know when AudioGraph as finished? ( I.E. the last sample has been rendered by kAudioUnitSubType_RemoteIO?


  • Subject: how to know when AudioGraph as finished? ( I.E. the last sample has been rendered by kAudioUnitSubType_RemoteIO?
  • From: Andy Davidson <email@hidden>
  • Date: Tue, 19 Jun 2012 16:26:40 -0700
  • Thread-topic: how to know when AudioGraph as finished? ( I.E. the last sample has been rendered by kAudioUnitSubType_RemoteIO?

Sorry if this has been asked before. I tried googling but did not find much.

I have a farily simple Audio Graph with a kAudioUnitSubType_AudioFilePlayer upstream and kAudioUnitSubType_RemoteIO down stream. In between their maybe an arbitrary number of Audio Units, and maybe a couple of buffers. How can I know when the last sample as been rendered by kAudioUnitSubType_RemoteIO ? I want to update my UI when this event occurs.

I know ScheduledAudioFileRegion.mCompletionProcUserData can be use to register a call back function to receive callbacks when the file player AU finishes how ever how would I know when all the samples have made their way through the entire graph?

 I found  AUGraphAddRenderNotify From the documentation


"Adds a callback that the graph will call every time the graph renders. The callback will be called once before the graph’s render operation, 

and once after the render operation is complete."


I wrote a little test program setting ScheduledAudioFileRegion.mCompletionProcUserData and using AUGraphAddRenderNotify().They share a boolean. The boolean is set in  ScheduledAudioFileRegion.mCompletionProcUserData, and check in the AUGraphAddRenderNotify callback. 


AudioFileRegionCompletionProc() {

Done = YES;

}


AUGraphAddRenderNotify() {

If (done) {

AUGraphStop(inUserData->audioGraph);

Update UI

}

}


When I ran my test program, I found AUGraphAddRenderNotify 2 times after done was set to true;  Causing stop to be cause twice


AUGraphAddRenderNotify    filePlayerFished = 0 AUGraphAddRenderNotifyCount = 1407

Audio Unit File Player callback : filePlayerFished = 1 AUGraphAddRenderNotifyCount = 1408

AUGraphAddRenderNotify    filePlayerFished = 1 AUGraphAddRenderNotifyCount = 1409

!!!!!!!!!! AUGraphAddRenderNotify stop !!!!!!!!!!!!

AUGraphAddRenderNotify     filePlayerFished = 1 AUGraphAddRenderNotifyCount = 1410

!!!!!!!!!! AUGraphAddRenderNotify stop !!!!!!!!!!!!


Where all the samples rendered? Also AUGraphAddRenderNotify() gets called twice on each render cycle. These seems like a lot of overhead.


Is there a better way to implement this?


Thanks


Andy

 _______________________________________________
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: how to know when AudioGraph as finished? ( I.E. the last sample has been rendered by kAudioUnitSubType_RemoteIO?
      • From: William Stewart <email@hidden>
  • Prev by Date: Echo removal vs latency: Switching between VPIO and Remote IO?
  • Next by Date: Re: how to know when AudioGraph as finished? ( I.E. the last sample has been rendered by kAudioUnitSubType_RemoteIO?
  • Previous by thread: Echo removal vs latency: Switching between VPIO and Remote IO?
  • Next by thread: Re: how to know when AudioGraph as finished? ( I.E. the last sample has been rendered by kAudioUnitSubType_RemoteIO?
  • Index(es):
    • Date
    • Thread