• 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
useful return values for Audio Unit callbacks?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

useful return values for Audio Unit callbacks?


  • Subject: useful return values for Audio Unit callbacks?
  • From: Rick Sustek <email@hidden>
  • Date: Thu, 16 Mar 2006 18:06:09 -0800

Hi gang,

The API docs have scant mention of return values, for the Audio Unit callback functions.

I am particularly interested in the _SetRenderCallback. This is usually shown as needing to return an OSStatus. We would normally return a 'noErr' to indicate everything is puppies and bunnies. However, I have seen in some Apple example code, a '-1' being returned, to indicate foul creatures instead. The comments in this sample code says this will cause "silence". (see ComplexPlayThru example)

Indeed, in my testing, a return value of '-1' produces silence, when used with the Apple Default Output Audio Unit.

However, other narrative in the docs suggest that to produce silence, one should zero-fill the provided buffer, and set the _OutputIsSilence flag in the ActionFlags, and (presumably) return with a 'noErr'.

Observe that simply returning a '-1' is much more efficient than taking the time to zero-fill a buffer, especially when long periods of silence are to be emitted, like when the application has nothing to do, but hasn't stopped the Audio Unit chain.

Comments or clarifications greatly appreciated!

Thanks,
Have fun,
-Rick



_______________________________________________
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: useful return values for Audio Unit callbacks?
      • From: William Stewart <email@hidden>
  • Prev by Date: Re: MIDIObjectGetStringProperty()
  • Next by Date: AUParameterListener notifying for events before listener is created?
  • Previous by thread: Re: AULab set properties before initializing
  • Next by thread: Re: useful return values for Audio Unit callbacks?
  • Index(es):
    • Date
    • Thread