@afkcodes/timbre-audio-session
Interfaces
| Interface | Description |
|---|---|
| AndroidAudioSessionConfig | Android half of AudioSessionConfig. Ignored on iOS. |
| AudioSessionApi | The public singleton surface. |
| AudioSessionConfig | Full 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. |
| AudioSessionEventMap | Payload delivered for each event name. becomingNoisy carries nothing — void keeps () => void assignable as a listener. |
| AudioSessionPlayerLike | The only thing wireAudioSession needs from a player. |
| AudioSessionRouteChangeEvent | A route change, as the JS layer sees it. |
| IosAudioSessionConfig | iOS half of AudioSessionConfig. Ignored on Android. |
| NativeInterruptionEvent | Flat interruption payload as it crosses the bridge. |
| NativeRouteChangeEvent | Route-change payload as it crosses the bridge. |
| RnMediaAudioSession | The single OS audio-session arbiter. |
| WireAudioSessionOptions | - |
Type Aliases
| Type Alias | Description |
|---|---|
| AndroidAudioContentType | AudioAttributes.CONTENT_TYPE_*. |
| AndroidAudioFocusGain | AudioManager.AUDIOFOCUS_GAIN*, i.e. AudioFocusRequest.Builder's focus gain. |
| AndroidAudioUsage | AudioAttributes.USAGE_*. |
| AudioInterruptionType | What the app is being asked to do for the duration of an interruption. |
| AudioRouteChangeReason | Unified route-change reason. |
| AudioSessionEventName | - |
| AudioSessionInterruptionEvent | An interruption, as the JS layer sees it. |
| IosAudioSessionCategory | AVAudioSession.Category. |
| IosAudioSessionCategoryOption | AVAudioSession.CategoryOptions. |
| IosAudioSessionMode | AVAudioSession.Mode. |
| IosRouteSharingPolicy | AVAudioSession.RouteSharingPolicy. |
| Unsubscribe | Removes the listener it was returned from. Idempotent. |
Variables
| Variable | Description |
|---|---|
| AudioSession | The process-wide audio session. |
| AudioSessionPresets | Ready-made AudioSessionConfigs. |
Functions
| Function | Description |
|---|---|
| createAudioSession | Build an AudioSessionApi on top of a native hybrid object. |
| wireAudioSession | Connect an audio session to a player: duck/pause on interruption, restore or resume when it ends, pause when the headphones are yanked. |