I created an application that starts playing audio when the application is founded. I start AVAudioSessionwith:
do {
try audioSession.setCategory(AVAudioSessionCategoryPlayback, with: .duckOthers)
} catch {
}
It works great, but is it possible to mute the sound of any other of the other applications when the application starts playing audio?
Without the duckOthers application, the application stops working because the above code runs in the background. And with duckOthers it will not mute the sound, it will simply lower the volume.
source
share