I'm writing a pitch detection app and allowing the user to switch between methods, one of which uses a different library to the others, and also set other things that require re-initialisating e.g. buffer size.
When the user selects a different method or value, the component calls deviceManager.closeAudioDevice() followed by the constructor (of the class inheriting AudioIODeviceCallback) with new settings, followed by deviceManager.restartLastAudioDevice().
Currently it seems the audioDeviceIOCallback function is still getting called before things are reinitialised
I assume I need to use audioDeviceStopped(), so I can safely reinitialise things. . Just not sure how to arrange the code, so it waits before doing stuff.