Skip to main content

Type Alias: AudioInterruptionType

type AudioInterruptionType = "duck" | "pause";

Defined in: packages/audio-session/src/specs/audio-session.nitro.ts:164

What the app is being asked to do for the duration of an interruption.

  • duck — Android AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK, and only when the config sets AndroidAudioSessionConfig.willPauseWhenDucked.
  • pause — Android AUDIOFOCUS_LOSS / AUDIOFOCUS_LOSS_TRANSIENT, and every iOS AVAudioSession.InterruptionType.began.

Platform asymmetry — duck is never emitted on iOS. This is a platform ceiling, not a gap: AVAudioSession.InterruptionType has exactly two cases, .began and .ended (https://developer.apple.com/documentation/avfaudio/avaudiosession/interruptiontype), and there is no notification anywhere in AVFAudio for "another session is ducking you". Ducking on iOS is applied by the system, to your audio, when another app activates a session carrying .duckOthers — your app is not told and does not act. The audible outcome therefore matches Android's default (willPauseWhenDucked: false, where the platform also ducks you without a callback, API 26+); what iOS cannot offer is Android's opt-out, i.e. "tell me instead so I can pause". An app whose content is speech gets the pause behaviour on Android and system ducking on iOS.