Callback on audio session interrupts and routing changes

I tested again. Both phone call interruptions and different apps that want to play music work as expected :slight_smile:

Iā€™m having an issue here when loading a movie via the iOS image picker from inside my app. The movie previewer sends interruption messages, and with the latest (the ā€œclose()ā€ solution) JUCE audio doesnā€™t resume after the movie previewer is being dismissed. Using isRunning = false; AudioOutputUnitStop (audioUnit); instead of close() fixes this. Seems that calling close() on kAudioSessionBeginInterruption is not properly balanced by what happens when kAudioSessionEndInterruption is called.

Okā€¦ seems reasonable. How about also balancing the session activity, i.e.

isrunning = false; AudioOutputUnitStop (audioUnit); AudioSessionSetActive (false);

?

Seems reasonable as well, and doesnā€™t make any noticeable difference in my use caseā€¦

Ok, will go with that. Thanks!