Re: Setting the AU's sample rate
Re: Setting the AU's sample rate
- Subject: Re: Setting the AU's sample rate
- From: Jeremy Sagan <email@hidden>
- Date: Mon, 5 Jul 2004 00:44:30 -0400
Marc,
Thanks for that because it does help.
I think the big problem here is a lack of explicitness in the AudioUnit
specification. Perhaps Bill can shed a little more light on this but I
went back and read some of the AU documentation and it is extremely
vague on which properties require the AU to be uninitialized when
called. For example what about
"kAudioUnitProperty_MaximumFramesPerSlice"? Does the AU need to be
uninitialized for that? I would really like to know directly whether I
can query for busses while the AU is uninitialized with the use of
"kAudioUnitProperty_BusCount" or if I can query for streams with
"kAudioUnitProperty_SupportedNumChannels" or
"kAudioUnitProperty_StreamFormat" while the AU is uninitialized?
I am now under the impression that the answer to all of the above is
yes.
The big problem for me is that supposedly AUInitialize can take a lot
of processing time (although I do not really see this) and therefore I
want to minimize my calls to AUInitialize but on the other hand before
the AU is initialized I am unsure of which property calls are legal and
I do not want to break anything that currently works correctly.
Therefore I want to minimize changes to a working code base. I know of
at least one (different) AU that will crash if uninitialized because
of a lingering event timer.
While doing some experimentation I would appreciate some
direction/answers,
Thanks,
Jeremy
On Jul 4, 2004, at 6:47 PM, Marc Poirier wrote:
On Sun, 4 Jul 2004, Jeremy Sagan wrote:
Marc,
On Jul 4, 2004, at 6:22 PM, Marc Poirier wrote:
It has recently come to my attention that changing the sample rate
before doing off-line rendering is crashing at least one AU plug-in.
Therefore I want to be absolutely sure that this is not a host
problem.
Is it necessary to AudioUnitUninitialize before changing the sample
rate?
It is possible for an AU to support StreamFormat changes while
Initialized, but most do not (and should return an error if you try
to).
Yes, for stream format changes I do uninit and init but this question
relates to explicitly sample rate changes.
Oh, it still counts as a stream format change though (I know there's a
separate property that you can use for sample rate, but if you actually
look at the AUBase implementation, you'll see that it's just a
convenience
shortcut to stream format). If you think about it, it makes sense with
the same logic, since an AU for example may need to allocate an audio
buffer that is a certain absolute duration of time, in which case a
change
in sampling rate will require reallocation with a new size, and hence
needs to happen outside of the rendering context. But anyway, none of
this helps explain your real problem here...
If I do this, the AU in question, does not crash but produces
silence instead and then the AU is in a weird state (e.g. does not
display properly any more).
Do you Initialize again after Uninitializing and then changing the
sampling rate?
Oh yes, definitely.
Okay, I figured so, but I thought I'd still ask in case that was the
really easy solution. :) Well, I don't know what to suggest then...
Marc
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.