• 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
Re: handling inequal in and out sample counts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: handling inequal in and out sample counts


  • Subject: Re: handling inequal in and out sample counts
  • From: Kevin Dixon <email@hidden>
  • Date: Thu, 16 Oct 2008 20:21:09 -0700

Thanks Bill, I suspected as much. Now that I have migrated my code to use AUBase, I'm running into this problem when I run auval:

TESTING OPEN TIMES:
COLD:
FATAL ERROR: OpenAComponent: result: -50,0xFFFFFFCE

I see this error result is due to an invalid or incorrect parameter. I think this error has to do with the COMPONENT_ENTRY macro, but I can't see how to fix it. Any advice? Thanks,

-Kevin


William Stewart wrote:
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
References: 
 >handling inequal in and out sample counts (From: Kevin Dixon <email@hidden>)
 >Re: handling inequal in and out sample counts (From: William Stewart <email@hidden>)

  • Prev by Date: Re: handling inequal in and out sample counts
  • Next by Date: ducking audio
  • Previous by thread: Re: handling inequal in and out sample counts
  • Next by thread: Re: AudioUnit problem: CFRunLoopRunInMode() spins after first thread exits, and second thread begins?
  • Index(es):
    • Date
    • Thread