• 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
Converting an AUGraph to offline mode
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Converting an AUGraph to offline mode


  • Subject: Converting an AUGraph to offline mode
  • From: Brian Willoughby <email@hidden>
  • Date: Tue, 28 Dec 2010 04:45:10 -0800

I have an AUGraph that is rendering properly to a file. I would like to convert this to offline mode, but it doesn't seem that AUGraph passes through the kAudioOfflineUnitRenderAction_* flags. In other words, when I call AudioUnitRender(), I start by passing in kAudioOfflineUnitRenderAction_Preflight and loop until kAudioOfflineUnitRenderAction_Complete is set, then I pass in kAudioOfflineUnitRenderAction_Render until kAudioOfflineUnitRenderAction_Complete is set. My AUGraph has a Matrix Mixer feeding High Pass Filter and Peak Limiter and ending with the Generic Output. The head of this AUGraph is a callback which uses ExtAudioFileRead() after checking the AudioUnitRenderActionFlags, but it seems that I never get any flags but 0.

The example offline host code only sets up a single AudioUnit, not a full AUGraph. So, I'm wondering what an AUHost is supposed to do when there is a whole graph of AudioUnits that need to be run offline, e.g., for bouncing to disk. Don't tell me that you must setup separate callbacks for every AU and call them independently for offline mode!

What I had hoped was that my flags would be passed through from AudioUnitRender() to the head of my graph, where my callback can use the ExtAudioFile to determine when to set the _Complete bit. Apparently, the Apple AUs overwrite the flags on return, or perhaps do not even pass them down when pulling their input data on render.

Has anyone worked with a full AUGraph in offline mode? I'd appreciate any comments or guidelines. The CoreAudio Mailing List archives do not seem to cover this combination.

Brian Willoughby
Sound Consulting


P.S. My AUGraph originally started with an AUAudioFilePlayer, which was working fine. But I discovered that AUAudioFilePlayer does not support offline mode, so I converted to using a callback with ExtAudioFile instead. Besides, AUAudioFilePlayer is probably less efficient, since it spawns an unneeded thread for the file I/O - a thread which probably doesn't help in an offline render anyway. Both versions - with and without AUAudioFilePlayer - work just fine when I do not use offline mode for the AUGraph. In fact, I suppose offline mode would work, too, if I replaced the code waiting for kAudioOfflineUnitRenderAction_Complete so that it checked some other flag that signaled the end of the input file.


Finally, at the risk of asking an unrelated question, is the Generic Output really needed? It seems like I could just call AudioUnitRender () on the Peak Limiter, since it is the final AU in my graph. I haven't tested this theory yet, but I am curious what the Generic Output really does.

_______________________________________________
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: Converting an AUGraph to offline mode
      • From: Brian Willoughby <email@hidden>
  • Prev by Date: Remote Control Events and AVAssetReader
  • Next by Date: Re: Converting an AUGraph to offline mode
  • Previous by thread: Remote Control Events and AVAssetReader
  • Next by thread: Re: Converting an AUGraph to offline mode
  • Index(es):
    • Date
    • Thread