Re: AudioUnit - notify on hosts beat and bar changes
Re: AudioUnit - notify on hosts beat and bar changes
- Subject: Re: AudioUnit - notify on hosts beat and bar changes
- From: Christian Rober <email@hidden>
- Date: Thu, 15 Jan 2015 12:44:54 -0500
On OS X, your host may set a property on your Audio Unit enumerated as
kAudioUnitProperty_HostCallbacks. The payload of the property is the
struct HostCallbackInfo, which in turn has a set of C function
callbacks. If that property is set by the host, you can extrapolate
the playback state and current beat position by calling those
functions. AUBase has a handy wrapper around all of this, of course.
Note: it is not guaranteed that a host who provides the struct will
return all the information from the output parameters to the
functions.
I have been able to call this at the beginning of each render cycle on
most hosts, and I believe this to be the standard way it is
implemented. So you should only really need to call it before you
render/process the samples per cycle.
For the record, this struct also exists on iOS, but via the Inter-App
Audio layer of the Audio Unit API.
Hope that helps.
--Christian
On Thu, Jan 15, 2015 at 12:11 PM, Nick <email@hidden> wrote:
> Hi
> Is there a way to get a notification in audio unit that a host started
> playback, and get a function called every metronome beat/or bar change?
> Thank you
>
> _______________________________________________
> 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
_______________________________________________
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