New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No sound on iOS after phone call during playback #1403
Comments
I am not sure how AudioKit can handle this generally for all apps. This would probably be better as a StackOverflow question because it deserves a conversation, whereas we try to use Github issues for more easily identifiable and tackle-able problems. |
Well, it seems AudioKit already does the right thing in several instances like interruptions by Siri for example. Plus it manages the AVSession object IIRC. But ultimately this is of course a decision that remains at your discretion. In any case a StackOverFlow post exists regarding the issue, but not much of a discussion so far. |
I have to agree with Aure on this - this is going to involve app-specific behaviour, and the way to handle that is to register for the notifications, and then do the shutdown / restart of your apps audio system yourself. |
I'm going to let this go onto StackOverflow until something becomes actionable by consensus over there. |
The desired behavior of iOS apps during AVAudioSessionInterruption events is to duck their sound and resume once the interruption has been handled. With AudioKit 4.2.x this is broken. Running the MetronomeSamplerSync on an iPhone for example, one can press one or both of the play buttons. As soon as a call comes in, the playback is faded out as indicated. Sound does however not come back after the phone call and both play buttons remain functionless. The app has to be restarted to produce sound again. Setting AKSettings.playbackWhileMuted = true or enabling background music entitlements on the app has no influence on this behavior.
Our app a bit presents the issue differently in that sound is recovered after a Siri session, where in the MetronomeSamplerSync that is not the case. It is however still affected with complete loss of sound after a phone call during playback and crashes if the call is held for longer than a minute. The main playback engine is an AKSequencer driving several AKMidiSamplers in addition to some AKSamplePlayers.
Our current workaround is a hedge by registering for the AVAudioSessionInterruption notification and stopping playback once a notification is encountered so that the audio engine object doesn't get hosed. Ideally, however, this would better be handled in AudioKit itself directly.
The text was updated successfully, but these errors were encountered: