Skip to main content

@afkcodes/timbre-audio-session

Interfaces

InterfaceDescription
AndroidAudioSessionConfigAndroid half of AudioSessionConfig. Ignored on iOS.
AudioSessionApiThe public singleton surface.
AudioSessionConfigFull audio-session configuration. Both halves are optional so a caller can supply only the platform they care about; the other platform then keeps whatever it was last configured with.
AudioSessionEventMapPayload delivered for each event name. becomingNoisy carries nothing — void keeps () => void assignable as a listener.
AudioSessionPlayerLikeThe only thing wireAudioSession needs from a player.
AudioSessionRouteChangeEventA route change, as the JS layer sees it.
IosAudioSessionConfigiOS half of AudioSessionConfig. Ignored on Android.
NativeInterruptionEventFlat interruption payload as it crosses the bridge.
NativeRouteChangeEventRoute-change payload as it crosses the bridge.
RnMediaAudioSessionThe single OS audio-session arbiter.
WireAudioSessionOptions-

Type Aliases

Type AliasDescription
AndroidAudioContentTypeAudioAttributes.CONTENT_TYPE_*.
AndroidAudioFocusGainAudioManager.AUDIOFOCUS_GAIN*, i.e. AudioFocusRequest.Builder's focus gain.
AndroidAudioUsageAudioAttributes.USAGE_*.
AudioInterruptionTypeWhat the app is being asked to do for the duration of an interruption.
AudioRouteChangeReasonUnified route-change reason.
AudioSessionEventName-
AudioSessionInterruptionEventAn interruption, as the JS layer sees it.
IosAudioSessionCategoryAVAudioSession.Category.
IosAudioSessionCategoryOptionAVAudioSession.CategoryOptions.
IosAudioSessionModeAVAudioSession.Mode.
IosRouteSharingPolicyAVAudioSession.RouteSharingPolicy.
UnsubscribeRemoves the listener it was returned from. Idempotent.

Variables

VariableDescription
AudioSessionThe process-wide audio session.
AudioSessionPresetsReady-made AudioSessionConfigs.

Functions

FunctionDescription
createAudioSessionBuild an AudioSessionApi on top of a native hybrid object.
wireAudioSessionConnect an audio session to a player: duck/pause on interruption, restore or resume when it ends, pause when the headphones are yanked.