Type Property

duckOthers

Causes audio from other sessions to be ducked (reduced in volume) while audio from this session plays.

Declaration

static var duckOthers: AVAudioSession.CategoryOptions { get }

Discussion

You can set this option only if the audio session category is playAndRecord, playback, or multiRoute. Setting this flag implicitly sets the mixWithOthers flag.

If this option is cleared, activating your session interrupts other audio sessions. If this option is set, your app's audio is mixed with audio playing in background apps (such as the Music app). Audio from other apps is reduced in volume when mixed with your app. Note that ducking begins when you activate your app’s audio session and ends when you deactivate the session.

Set this option if you want audio from your app (for example, voice prompts in a navigation app) to be heard over music or other currently playing audio. If your app provides occasional spoken audio, such as in a turn-by-turn navigation app or an exercise app, you should also set the interruptSpokenAudioAndMixWithOthers option.