AU latency change

this was asked before for RTAS. Is there a way to notify the AU host that the latency is changed? The AU doc says that this should be possible :

[i]kAudioUnitProperty_Latency

If the sample latency for your audio unit varies, use this property to report the maximum latency. Alternatively, you can update the kAudioUnitProperty_Latency property value when latency changes, and issue a property change notification using the Audio Unit Event API.


[/i]

Is this possible in Juce?

I haven’t added latency change notification to the API, but I’m sure it could be done. Too busy working on other areas to task-switch over to plugin coding at the moment, though…

I’ve looked into the subject before, but it does not seem an easy task, look here:

Yeah, not too surprising to hear that hosts might ignore or have problems with latency changes.

Seems like all it requires is one line in JuceAU::audioProcessorChanged

    void audioProcessorChanged (AudioProcessor*)
    {
        PropertyChanged (kAudioUnitProperty_Latency, kAudioUnitScope_Global, 0);
    }

Works for me in Logic (the user needs to stop and play before the change takes effect but it does take effect)

Cheers! Yair

What’s “PropertyChanged”? Is that a global function, or something in the AU classes?

it’s a method of AUBase

Ah! Excellent idea, thanks!