Skip to main content
Back to plugins
@capgo/capacitor-audiosession
Tutorial
by github.com/Cap-go

Audio Session

Configure iOS audio session for background playback, mixing, and routing control

Guide

Tutorial on Audio Session

Using @capgo/capacitor-audio-session

iOS-only plugin to query and control the audio session output and listen to route changes and interruptions.

Install

bun add @capgo/capacitor-audio-session
bunx cap sync

What This Plugin Exposes

  • currentOutputs - Get the current active audio output routes.
  • overrideOutput - Override the current audio output route.

Example Usage

currentOutputs

Get the current active audio output routes.

import { AudioSession } from '@capgo/capacitor-audio-session';

await AudioSession.currentOutputs();

overrideOutput

Override the current audio output route.

import { AudioSession } from '@capgo/capacitor-audio-session';

await AudioSession.overrideOutput({} as OutputOverrideType);

Full Reference