Skip to main content

Type Alias: AudioRouteChangeReason

type AudioRouteChangeReason =
| "unknown"
| "newDeviceAvailable"
| "oldDeviceUnavailable"
| "categoryChange"
| "routeOverride"
| "wakeFromSleep"
| "noSuitableRouteForCategory"
| "routeConfigurationChange";

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

Unified route-change reason.

Values mirror AVAudioSession.RouteChangeReason.

Platform asymmetry — Android only ever produces newDeviceAvailable / oldDeviceUnavailable. A ceiling, not a gap: Android has no route-change notification. The nearest platform signal is AudioManager.registerAudioDeviceCallback, whose entire surface is onAudioDevicesAdded / onAudioDevicesRemoved (https://developer.android.com/reference/android/media/AudioDeviceCallback), so the other six reasons have no source to come from. categoryChange, routeOverride, wakeFromSleep, noSuitableRouteForCategory and routeConfigurationChange are iOS-only values; unknown is reachable on iOS only (an AVAudioSession.RouteChangeReason this build does not recognise).

NOTE: routeOverride is Apple's .override, renamed to keep the generated Swift enumerator (.override) away from Swift's override modifier.