I am writing an app that hosts apple system supplied audiounits. I would like to save the parameter states of an audiounit after a user has dialed them in and restore them when the user loads the audiounit again.

I can't find out to do this from a host. I've seen that AUs should have SaveState() and RestoreState() methods, but how do you access them?

Accepted Answer

Basically, you handle them by getting or setting the kAudioUnitProperty_ClassInfo property with AudioUnitGetProperty() or AudioUnitSetProperty() (for saving and restoring, respectively).

You can see an example implementation of this in the DestroyFX Audio Unit utilities library in the methods RestoreAUStateFromPresetFile() and SaveAUStateToPresetFile_Bundle() in the dfx-au-utilities-preset-files.c file.

Written by Nik Reiman
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki