Can I detect when selected audio device sample rate changes?

We have an app that uses an AudioDeviceManager and AudioDevicePlayer to play back audio via the device they select in a ComboBox. But we noticed that if the user goes to their system settings and changes the sample rate of the audio device while it is playing, then the audio continues playing, but at the wrong sample rate. We check when starting playback what sample rate the device supports, and tell it to play at our desired rate, and that is working. But I don’t see any callback that tells our app if the user changes the sample rate via their system settings (e.g., via AudioMIDISetup on the Mac).

How can we detect a change in sample rate of the device we’re currently using, during playback, so that we can take some kind of appropriate action? (We haven’t decided on exactly what action yet.)

I think this goes back all the way to sampleRateHasChanged on OSX…

Rail

Hi Howard, this is what I usually do in these cases, maybe it can help you: Audio stops working after changing samplerate externally - #2 by masshacker