Re: handling inequal in and out sample counts
Re: handling inequal in and out sample counts
- Subject: Re: handling inequal in and out sample counts
- From: William Stewart <email@hidden>
- Date: Thu, 16 Oct 2008 10:40:41 -0700
Different audio units have a different notion of I/O limitations
Effect and Music Device units are expected to behave as "real-time" -
that is that they will ONLY request input that matches their request
for output. So, that precludes the ability to have different sample
rates on input and output, or a varispeeding type of rate control.
This covers the au types of 'aufx', 'aumf', 'aumd', 'aupn'. Mixers are
also expected to behave in this manner as well.
For processing that can have a difference between in and out
requirements are of the format converter type (and the offline type) -
'aufc' or 'auol' - output units (auou) also fit into this category.
Apple's list of format converter's include a generic AUConverter (that
can do sample rate conversions), AUVarispeed and AUTimePitch
The reason for this distinction is due to the hosting requirements for
an audio unit that can pull more or less input than its output. In
AULab (to take an example) it allows only "effects" to appear in audio
chains where the source is either a music device or an audio input.
However, if the source is a generator unit, we allow converter units
as many generator units (think of a file player or a noise/tone
generator) are not really real-time limited.
Finally, to distinguish between a format converter (and a generator)
unit that might be useful to use within a hosting context, the unit
publishes a custom view - even if it is only a republishing of the
generic view. For example, the varispeed and time pitch are quite
useful audio units to use in a host app, so they publish a custom view
which is the generic view. AUFilePlayer also publishes its own view.
The other generator and aufc units we ship are not useful without some
kind of custom handling or UI - so they don't have a custom view and
won't show up in a hosting app.
Finally - for implementing one of these (aufc or generator) you need
to start from AUBase. AUEffectBase is not appropriate for this kind of
audio unit.
Bill
On Oct 15, 2008, at 8:29 PM, Kevin Dixon wrote:
Hi,
I'm wondering how you deal with inequal input and output sample
counts.
In this case, I'm writing an offline varispeed, so the output number
of samples will almost never be the same as input, and could easily
be more or less. Should I override the main Render method? The
Kernel model doesn't seem like it would be particularly fitting in
this case.
Thanks,
-Kevin
_______________________________________________
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