External Changes to AudioDeviceManager Sample Rate


#1

What are the usual approaches to dealing with changes made by external sources to the sample rate of the currently in-use Audio Device?

For example, changing the sample rate using the macOS Audio Midi Setup application whilst running the Juce Demo app causes the audio to stop and the app to crash when I change the sample rate, whilst Ableton Live seems to update itself to the new settings when external changes are made.


#2

See previous threads:

and

Cheers.

Rail


#3

Cheers Rail, didn’t catch those threads when I posted last night


#4

I’ve just pushed this commit

which should improve things. If your application is using a single audio device (the input and the output device have the same name) then things are relatively straightforward. If you’re using separate input and output devices, and you change the sample rate of one of them, then the iOSAudioDevice will attempt to change the sample rate of the other to match. If this is not possible then playback will stop.