---
description: Capacitor plugin for audio recording using the device's microphone. It supports recording, pausing, and stopping audio sessions.
title: Capacitor Audio Recorder Plugin for Android, iOS & Web - Capawesome
image: https://capawesome.io/docs/assets/images/social/plugins/audio-recorder.png
---

[ Skip to content](#capawesome-teamcapacitor-audio-recorder) 

[ 🎉 Introducing **Capawesome Platform** — one platform for Live Updates, Native Builds, App Store Publishing, and Insider SDKs.](https://capawesome.io) 

* [  iOS ](#ios)
* [  Configuration ](#configuration)
* [  Usage ](#usage)
* [  API ](#api)
* [  Type Aliases ](#type-aliases)
* [  Enums ](#enums)
* [  Troubleshooting ](#troubleshooting)
* [  Changelog ](#changelog)
* [  Breaking Changes ](#breaking-changes)
* [  License ](#license)
* [  Background Task ](/docs/plugins/background-task/)
* [  Badge ](/docs/plugins/badge/)
* [  Barometer ](/docs/plugins/barometer/)
* [  Biometrics ](/docs/plugins/biometrics/)
* [  Bluetooth Low Energy ](/docs/plugins/bluetooth-low-energy/)
* [  Cloudinary ](/docs/plugins/cloudinary/)
* [  Contacts ](/docs/plugins/contacts/)
* [  Datetime Picker ](/docs/plugins/datetime-picker/)
* [  File Compressor ](/docs/plugins/file-compressor/)
* [  File Opener ](/docs/plugins/file-opener/)
* [  File Picker ](/docs/plugins/file-picker/)
* [  Firebase ](/docs/plugins/firebase/)
* [  Formbricks ](/docs/plugins/formbricks/)
* [  Geocoder ](/docs/plugins/geocoder/)
* [  Google Sign-In ](/docs/plugins/google-sign-in/)
* [  libSQL ](/docs/plugins/libsql/)
* [  Live Update ](/docs/plugins/live-update/)
* [  Managed Configurations ](/docs/plugins/managed-configurations/)
* [  Media Session ](/docs/plugins/media-session/)
* [  ML Kit ](/docs/plugins/mlkit/)
* [  NFC ](/docs/plugins/nfc/)
* [  OAuth ](/docs/plugins/oauth/)
* [  Pedometer ](/docs/plugins/pedometer/)
* [  Photo Editor ](/docs/plugins/photo-editor/)
* [  PostHog ](/docs/plugins/posthog/)
* [  Printer ](/docs/plugins/printer/)
* [  Purchases ](/docs/plugins/purchases/)
* [  RealtimeKit ](/docs/plugins/realtimekit/)
* [  Screen Orientation ](/docs/plugins/screen-orientation/)
* [  Screenshot ](/docs/plugins/screenshot/)
* [  Secure Preferences ](/docs/plugins/secure-preferences/)
* [  Speech Recognition ](/docs/plugins/speech-recognition/)
* [  Speech Synthesis ](/docs/plugins/speech-synthesis/)
* [  Share Target ](/docs/plugins/share-target/)
* [  Square Mobile Payments ](/docs/plugins/square-mobile-payments/)
* [  SQLite ](/docs/plugins/sqlite/)
* [  Superwall ](/docs/plugins/superwall/)
* [  Torch ](/docs/plugins/torch/)
* [  Wifi ](/docs/plugins/wifi/)
* [  Zip ](/docs/plugins/zip/)
* [  Cloud ](/docs/cloud/)
* [  Live Updates ](/docs/cloud/live-updates/)
* Advanced
* Integrations
* [  Native Builds ](/docs/cloud/native-builds/)
* [  Configuration ](/docs/cloud/native-builds/configuration/)
* [  Environments ](/docs/cloud/native-builds/environments/)
* Guides
* [  Sample Projects ](/docs/cloud/native-builds/sample-projects/)
* [  Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [  Automations ](/docs/cloud/automations/)
* [  Assist ](/docs/cloud/assist/)
* Account
* Organizations
* [  Organization and User Management ](/docs/cloud/organizations/memberships/)
* [  Single Sign-On (SSO) ](/docs/cloud/organizations/sso/)
* [  Teams ](/docs/cloud/organizations/teams/)
* [  Two-Factor Authentication ](/docs/cloud/organizations/two-factor-authentication/)
* [  Integrations ](/docs/cloud/integrations/)
* [  License Keys ](/docs/cloud/license-keys/)
* [  Webhooks ](/docs/cloud/webhooks/)
* [  Pricing ](https://capawesome.io/pricing/)
* [  FAQ ](/docs/cloud/faq/)
* [  Support ](/docs/cloud/support/)
* [  Contributing ](/docs/contributing/)
* [  LLMs ](/docs/llms/)
* [  Insiders ](/docs/insiders/)
* [  License ](https://capawesome.io/legal/eula/)
* [  Support ](/docs/insiders/support/)
* [  FAQ ](/docs/insiders/faq/)
* [  Blog ](/blog/)
* Categories

* [  iOS ](#ios)
* [  Configuration ](#configuration)
* [  Usage ](#usage)
* [  API ](#api)
* [  Type Aliases ](#type-aliases)
* [  Enums ](#enums)
* [  Troubleshooting ](#troubleshooting)
* [  Changelog ](#changelog)
* [  Breaking Changes ](#breaking-changes)
* [  License ](#license)

# @capawesome-team/capacitor-audio-recorder[¶](#capawesome-teamcapacitor-audio-recorder "Permanent link")

Capacitor plugin for seamless audio recording using the device's microphone. Supports Android, iOS, and Web with advanced features and high performance.

[ ![Deliver Live Updates to your Capacitor app with Capawesome Cloud](../../assets/external/cloud.capawesome.io/assets/banners/cloud-build-and-deploy-capacitor-apps.69628c3f.png) ](https://cloud.capawesome.io/) 

## Features[¶](#features "Permanent link")

We are proud to offer one of the most complete and feature-rich Capacitor plugins for audio recording. Here are some of the key features:

* 🖥️ **Cross-platform**: Supports Android, iOS and Web.
* ⏯️ **Full Control**: Start, pause, resume, cancel and stop recording.
* 🚀 **Performance**: Record long audio sessions without any performance issues.
* 🔑 **Permissions**: Check and request microphone permissions.
* 🔊 **Events**: Listen for events like `recordingError`, `recordingPaused` or `recordingStopped`.
* 🌙 **Background Mode**: Record audio even when the app is in the background.
* 🤝 **Compatibility**: Compatible with the [Audio Player](https://capawesome.io/docs/plugins/audio-player/), [Speech Recognition](https://capawesome.io/docs/plugins/speech-recognition/) and [Speech Synthesis](https://capawesome.io/docs/plugins/speech-synthesis/) plugins.
* 📦 **CocoaPods & SPM**: Supports CocoaPods and Swift Package Manager for iOS.
* 🔁 **Up-to-date**: Always supports the latest Capacitor version.
* ⭐️ **Support**: Priority support from the Capawesome Team.
* ✨ **Handcrafted**: Built from the ground up with care and expertise, not forked or AI-generated.

Missing a feature? Just [open an issue](https://github.com/capawesome-team/capacitor-plugins/issues) and we'll take a look!

## Newsletter[¶](#newsletter "Permanent link")

Stay up to date with the latest news and updates about the Capawesome, Capacitor, and Ionic ecosystem by subscribing to our [Capawesome Newsletter](https://cloud.capawesome.io/newsletter/).

## Compatibility[¶](#compatibility "Permanent link")

| Plugin Version | Capacitor Version | Status         |
| -------------- | ----------------- | -------------- |
| 8.x.x          | \>=8.x.x          | Active support |
| 7.x.x          | 7.x.x             | Deprecated     |

## Guides[¶](#guides "Permanent link")

* [Announcing the Capacitor Audio Recorder Plugin](https://capawesome.io/blog/announcing-the-capacitor-audio-recorder-plugin/)
* [Exploring the Capacitor Audio Recorder API](https://capawesome.io/blog/exploring-the-capacitor-audio-recorder-api/)

## Installation[¶](#installation "Permanent link")

This plugin is only available to [Capawesome Insiders](https://capawesome.io/insiders/). First, make sure you have the Capawesome npm registry set up. You can do this by running the following commands:

`[](#%5F%5Fcodelineno-0-1)npm config set @capawesome-team:registry https://npm.registry.capawesome.io
[](#%5F%5Fcodelineno-0-2)npm config set //npm.registry.capawesome.io/:_authToken <YOUR_LICENSE_KEY>
`

**Attention**: Replace `<YOUR_LICENSE_KEY>` with the license key you received from Polar. If you don't have a license key yet, you can get one by becoming a [Capawesome Insider](https://capawesome.io/insiders/).

Next, you can use our **AI-Assisted Setup** to install the plugin. Add the [Capawesome Skills](https://github.com/capawesome-team/skills) to your AI tool using the following command:

`[](#%5F%5Fcodelineno-1-1)npx skills add capawesome-team/skills --skill capacitor-plugins
`

Then use the following prompt:

`` [](#%5F%5Fcodelineno-2-1)Use the `capacitor-plugins` skill from `capawesome-team/skills` to install the `@capawesome-team/capacitor-audio-recorder` plugin in my project.
 ``

If you prefer **Manual Setup**, install the plugin by running the following commands and follow the platform-specific instructions below:

`[](#%5F%5Fcodelineno-3-1)npm install @capawesome-team/capacitor-audio-recorder
[](#%5F%5Fcodelineno-3-2)npx cap sync
`

### Android[¶](#android "Permanent link")

#### Proguard[¶](#proguard "Permanent link")

If you are using Proguard, you need to add the following rules to your `proguard-rules.pro` file:

`[](#%5F%5Fcodelineno-4-1)-keep class io.capawesome.capacitorjs.plugins.** { *; }
`

### iOS[¶](#ios "Permanent link")

#### Capabilities[¶](#capabilities "Permanent link")

If you want to record audio in the background, ensure `Background Modes` capability is enabled with `Audio, AirPlay, and Picture in Picture` in your Xcode project. See [Add a capability to a target](https://help.apple.com/xcode/mac/current/#/dev88ff319e7) for more information.

#### Privacy Descriptions[¶](#privacy-descriptions "Permanent link")

Add the `NSMicrophoneUsageDescription` key to the `ios/App/App/Info.plist` file, which tells the user why your app needs access to the user's contacts:

`[](#%5F%5Fcodelineno-5-1)<key>NSMicrophoneUsageDescription</key>
[](#%5F%5Fcodelineno-5-2)<string>We need access to your microphone to record audio.</string>
`

## Configuration[¶](#configuration "Permanent link")

No configuration required for this plugin.

## Usage[¶](#usage "Permanent link")

`[](#%5F%5Fcodelineno-6-1)import { AudioRecorder, AudioSessionCategoryOption, AudioSessionMode } from '@capawesome-team/capacitor-audio-recorder';
[](#%5F%5Fcodelineno-6-2)import { AudioPlayer } from '@capawesome-team/capacitor-audio-player';
[](#%5F%5Fcodelineno-6-3)import { Directory, Filesystem } from '@capacitor/filesystem';
[](#%5F%5Fcodelineno-6-4)
[](#%5F%5Fcodelineno-6-5)const startRecording = async () => {
[](#%5F%5Fcodelineno-6-6)  await AudioRecorder.startRecording({
[](#%5F%5Fcodelineno-6-7)    audioSessionCategoryOptions: [AudioSessionCategoryOption.DuckOthers],
[](#%5F%5Fcodelineno-6-8)    audioSessionMode: AudioSessionMode.Measurement,
[](#%5F%5Fcodelineno-6-9)    bitRate: 192000,
[](#%5F%5Fcodelineno-6-10)    sampleRate: 44100
[](#%5F%5Fcodelineno-6-11)  });
[](#%5F%5Fcodelineno-6-12)};
[](#%5F%5Fcodelineno-6-13)
[](#%5F%5Fcodelineno-6-14)const startRecordingToCustomLocation = async () => {
[](#%5F%5Fcodelineno-6-15)  const { uri } = await Filesystem.getUri({
[](#%5F%5Fcodelineno-6-16)    directory: Directory.Data,
[](#%5F%5Fcodelineno-6-17)    path: 'recordings/my-recording.aac'
[](#%5F%5Fcodelineno-6-18)  });
[](#%5F%5Fcodelineno-6-19)  await AudioRecorder.startRecording({ uri });
[](#%5F%5Fcodelineno-6-20)};
[](#%5F%5Fcodelineno-6-21)
[](#%5F%5Fcodelineno-6-22)const stopRecording = async () => {
[](#%5F%5Fcodelineno-6-23)  // Stop recording and get the audio blob or URI
[](#%5F%5Fcodelineno-6-24)  const { blob, uri } = await AudioRecorder.stopRecording();
[](#%5F%5Fcodelineno-6-25)  // Play the audio
[](#%5F%5Fcodelineno-6-26)  if (blob) {
[](#%5F%5Fcodelineno-6-27)    // Only available on Web
[](#%5F%5Fcodelineno-6-28)    await AudioPlayer.play({ blob });
[](#%5F%5Fcodelineno-6-29)  } else if (uri) {
[](#%5F%5Fcodelineno-6-30)    // Only available on Android and iOS
[](#%5F%5Fcodelineno-6-31)    await AudioPlayer.play({ uri });
[](#%5F%5Fcodelineno-6-32)  }
[](#%5F%5Fcodelineno-6-33)};
[](#%5F%5Fcodelineno-6-34)
[](#%5F%5Fcodelineno-6-35)const pauseRecording = async () => {
[](#%5F%5Fcodelineno-6-36)  await AudioRecorder.pauseRecording();
[](#%5F%5Fcodelineno-6-37)};
[](#%5F%5Fcodelineno-6-38)
[](#%5F%5Fcodelineno-6-39)const resumeRecording = async () => {
[](#%5F%5Fcodelineno-6-40)  await AudioRecorder.resumeRecording();
[](#%5F%5Fcodelineno-6-41)};
[](#%5F%5Fcodelineno-6-42)
[](#%5F%5Fcodelineno-6-43)const cancelRecording = async () => {
[](#%5F%5Fcodelineno-6-44)  await AudioRecorder.cancelRecording();
[](#%5F%5Fcodelineno-6-45)};
[](#%5F%5Fcodelineno-6-46)
[](#%5F%5Fcodelineno-6-47)const getRecordingStatus = async () => {
[](#%5F%5Fcodelineno-6-48)  const { status } = await AudioRecorder.getRecordingStatus();
[](#%5F%5Fcodelineno-6-49)  console.log('Recording status:', status);
[](#%5F%5Fcodelineno-6-50)};
[](#%5F%5Fcodelineno-6-51)
[](#%5F%5Fcodelineno-6-52)const checkPermissions = async () => {
[](#%5F%5Fcodelineno-6-53)  const { recordAudio } = await AudioRecorder.checkPermissions();
[](#%5F%5Fcodelineno-6-54)  console.log('Record audio permission:', recordAudio);
[](#%5F%5Fcodelineno-6-55)};
[](#%5F%5Fcodelineno-6-56)
[](#%5F%5Fcodelineno-6-57)const requestPermissions = async () => {
[](#%5F%5Fcodelineno-6-58)  const { recordAudio } = await AudioRecorder.requestPermissions();
[](#%5F%5Fcodelineno-6-59)  console.log('Record audio permission:', recordAudio);
[](#%5F%5Fcodelineno-6-60)};
[](#%5F%5Fcodelineno-6-61)
[](#%5F%5Fcodelineno-6-62)const addRecordingErrorListener = async () => {
[](#%5F%5Fcodelineno-6-63)  await AudioRecorder.addListener('recordingError', (event) => {
[](#%5F%5Fcodelineno-6-64)    console.error('Recording error:', event.message);
[](#%5F%5Fcodelineno-6-65)  });
[](#%5F%5Fcodelineno-6-66)};
[](#%5F%5Fcodelineno-6-67)
[](#%5F%5Fcodelineno-6-68)const addRecordingPausedListener = async () => {
[](#%5F%5Fcodelineno-6-69)  await AudioRecorder.addListener('recordingPaused', () => {
[](#%5F%5Fcodelineno-6-70)    console.log('Recording paused');
[](#%5F%5Fcodelineno-6-71)  });
[](#%5F%5Fcodelineno-6-72)};
[](#%5F%5Fcodelineno-6-73)
[](#%5F%5Fcodelineno-6-74)const addRecordingStoppedListener = async () => {
[](#%5F%5Fcodelineno-6-75)  await AudioRecorder.addListener('recordingStopped', (event) => {
[](#%5F%5Fcodelineno-6-76)    console.log('Recording stopped:', event.uri);
[](#%5F%5Fcodelineno-6-77)  });
[](#%5F%5Fcodelineno-6-78)};
`

## API[¶](#api "Permanent link")

* [cancelRecording()](#cancelrecording)
* [getRecordingStatus()](#getrecordingstatus)
* [pauseRecording()](#pauserecording)
* [resumeRecording()](#resumerecording)
* [startRecording(...)](#startrecording)
* [stopRecording()](#stoprecording)
* [checkPermissions()](#checkpermissions)
* [requestPermissions()](#requestpermissions)
* [addListener('recordingError', ...)](#addlistenerrecordingerror-)
* [addListener('recordingPaused', ...)](#addlistenerrecordingpaused-)
* [addListener('recordingResumed', ...)](#addlistenerrecordingresumed-)
* [addListener('recordingStopped', ...)](#addlistenerrecordingstopped-)
* [Interfaces](#interfaces)
* [Type Aliases](#type-aliases)
* [Enums](#enums)

### cancelRecording()[¶](#cancelrecording "Permanent link")

`[](#%5F%5Fcodelineno-7-1)cancelRecording() => Promise<void>
`

Cancel the recording.

**Since:** 7.0.0

---

### getRecordingStatus()[¶](#getrecordingstatus "Permanent link")

`[](#%5F%5Fcodelineno-8-1)getRecordingStatus() => Promise<GetRecordingStatusResult>
`

Check if the device supports audio recording.

**Returns:** `Promise<[GetRecordingStatusResult](#getrecordingstatusresult)>`

**Since:** 7.0.0

---

### pauseRecording()[¶](#pauserecording "Permanent link")

`[](#%5F%5Fcodelineno-9-1)pauseRecording() => Promise<void>
`

Pause the recording.

This method is only available on Android (SDK 24+), iOS and Web.

**Since:** 7.0.0

---

### resumeRecording()[¶](#resumerecording "Permanent link")

`[](#%5F%5Fcodelineno-10-1)resumeRecording() => Promise<void>
`

Resume the recording.

This method is only available on Android (SDK 24+), iOS and Web.

**Since:** 7.0.0

---

### startRecording(...)[¶](#startrecording "Permanent link")

`[](#%5F%5Fcodelineno-11-1)startRecording(options?: StartRecordingOptions | undefined) => Promise<void>
`

Start recording audio in AAC format.

| Param       | Type                                            |
| ----------- | ----------------------------------------------- |
| **options** | [StartRecordingOptions](#startrecordingoptions) |

**Since:** 7.0.0

---

### stopRecording()[¶](#stoprecording "Permanent link")

`[](#%5F%5Fcodelineno-12-1)stopRecording() => Promise<StopRecordingResult>
`

Stop recording audio.

**Returns:** `Promise<[StopRecordingResult](#stoprecordingresult)>`

**Since:** 7.0.0

---

### checkPermissions()[¶](#checkpermissions "Permanent link")

`[](#%5F%5Fcodelineno-13-1)checkPermissions() => Promise<PermissionStatus>
`

Check permissions for audio recording.

**Returns:** `Promise<[PermissionStatus](#permissionstatus)>`

**Since:** 7.0.0

---

### requestPermissions()[¶](#requestpermissions "Permanent link")

`[](#%5F%5Fcodelineno-14-1)requestPermissions() => Promise<PermissionStatus>
`

Request permissions for audio recording.

**Returns:** `Promise<[PermissionStatus](#permissionstatus)>`

**Since:** 7.0.0

---

### addListener('recordingError', ...)[¶](#addlistenerrecordingerror "Permanent link")

`[](#%5F%5Fcodelineno-15-1)addListener(eventName: 'recordingError', listenerFunc: (event: RecordingErrorEvent) => void) => Promise<PluginListenerHandle>
`

Called when an error occurs during recording. The recording will be cancelled.

Only available on iOS.

| Param            | Type                                                         |
| ---------------- | ------------------------------------------------------------ |
| **eventName**    | 'recordingError'                                             |
| **listenerFunc** | (event: [RecordingErrorEvent](#recordingerrorevent)) => void |

**Returns:** `Promise<[PluginListenerHandle](#pluginlistenerhandle)>`

**Since:** 7.0.0

---

### addListener('recordingPaused', ...)[¶](#addlistenerrecordingpaused "Permanent link")

`[](#%5F%5Fcodelineno-16-1)addListener(eventName: 'recordingPaused', listenerFunc: () => void) => Promise<PluginListenerHandle>
`

Called when the recording is paused (e.g. when the recording is interrupted by a phone call).

| Param            | Type              |
| ---------------- | ----------------- |
| **eventName**    | 'recordingPaused' |
| **listenerFunc** | () => void        |

**Returns:** `Promise<[PluginListenerHandle](#pluginlistenerhandle)>`

**Since:** 7.1.0

---

### addListener('recordingResumed', ...)[¶](#addlistenerrecordingresumed "Permanent link")

`[](#%5F%5Fcodelineno-17-1)addListener(eventName: 'recordingResumed', listenerFunc: () => void) => Promise<PluginListenerHandle>
`

Called when the recording is resumed (e.g. after an audio session interruption ends, when `autoResumeAfterInterruption` is enabled).

| Param            | Type               |
| ---------------- | ------------------ |
| **eventName**    | 'recordingResumed' |
| **listenerFunc** | () => void         |

**Returns:** `Promise<[PluginListenerHandle](#pluginlistenerhandle)>`

**Since:** 8.2.0

---

### addListener('recordingStopped', ...)[¶](#addlistenerrecordingstopped "Permanent link")

`[](#%5F%5Fcodelineno-18-1)addListener(eventName: 'recordingStopped', listenerFunc: (event: RecordingStoppedEvent) => void) => Promise<PluginListenerHandle>
`

Called when the recording is stopped.

**Note**: This will not be called if the recording is cancelled or paused or if an error occurs.

| Param            | Type                                                             |
| ---------------- | ---------------------------------------------------------------- |
| **eventName**    | 'recordingStopped'                                               |
| **listenerFunc** | (event: [RecordingStoppedEvent](#recordingstoppedevent)) => void |

**Returns:** `Promise<[PluginListenerHandle](#pluginlistenerhandle)>`

**Since:** 6.0.0

---

### Interfaces[¶](#interfaces "Permanent link")

#### GetRecordingStatusResult[¶](#getrecordingstatusresult "Permanent link")

| Prop       | Type                                | Description                   | Default                  | Since |
| ---------- | ----------------------------------- | ----------------------------- | ------------------------ | ----- |
| **status** | [RecordingStatus](#recordingstatus) | The current recording status. | RecordingStatus.Inactive | 7.0.0 |

#### StartRecordingOptions[¶](#startrecordingoptions "Permanent link")

| Prop                            | Type                                  | Description                                                                                                                                                                                                                                                               | Default                  | Since |
| ------------------------------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | ----- |
| **autoResumeAfterInterruption** | boolean                               | Whether the recording should automatically resume after an audio session interruption ends (e.g. after a phone call). The system only resumes the recording if it indicates that resuming is appropriate. Only available on iOS.                                          | false                    | 8.2.0 |
| **audioSessionCategoryOptions** | AudioSessionCategoryOption\[\]        | The audio session category options for recording. Only available on iOS.                                                                                                                                                                                                  | \['duckOthers'\]         | 7.5.0 |
| **audioSessionMode**            | [AudioSessionMode](#audiosessionmode) | The audio session mode for recording. Only available on iOS.                                                                                                                                                                                                              | AudioSessionMode.Default | 7.4.0 |
| **bitRate**                     | number                                | The audio bitrate in bytes per second. This option is only available on Android and iOS.                                                                                                                                                                                  | 192000                   | 7.2.0 |
| **sampleRate**                  | number                                | The audio sample rate in Hz. This option is only available on Android and iOS.                                                                                                                                                                                            | 44100                    | 7.1.0 |
| **uri**                         | string                                | The URI where the recorded audio should be saved. If not provided, the recording is saved to a temporary location in the cache directory. **Tip:** Generate this path using the getUri(...) method of the Capacitor Filesystem plugin. Only available on Android and iOS. | 8.1.0                    |       |

#### StopRecordingResult[¶](#stoprecordingresult "Permanent link")

| Prop         | Type   | Description                                                       | Since |
| ------------ | ------ | ----------------------------------------------------------------- | ----- |
| **blob**     | Blob   | The recorded audio as a Blob. Only available on Web.              | 7.0.0 |
| **duration** | number | The duration of the recorded audio in milliseconds.               | 7.1.0 |
| **uri**      | string | The URI of the recorded audio. Only available on Android and iOS. | 7.0.0 |

#### PermissionStatus[¶](#permissionstatus "Permanent link")

| Prop            | Type                                | Description                               | Since |
| --------------- | ----------------------------------- | ----------------------------------------- | ----- |
| **recordAudio** | [PermissionState](#permissionstate) | The permission state for audio recording. | 7.0.0 |

#### PluginListenerHandle[¶](#pluginlistenerhandle "Permanent link")

| Prop       | Type                |
| ---------- | ------------------- |
| **remove** | () => Promise<void> |

#### RecordingErrorEvent[¶](#recordingerrorevent "Permanent link")

| Prop        | Type   | Description        | Since |
| ----------- | ------ | ------------------ | ----- |
| **message** | string | The error message. | 7.0.0 |

#### RecordingStoppedEvent[¶](#recordingstoppedevent "Permanent link")

| Prop         | Type   | Description                                                       | Since |
| ------------ | ------ | ----------------------------------------------------------------- | ----- |
| **blob**     | Blob   | The recorded audio as a Blob. Only available on Web.              | 7.0.0 |
| **duration** | number | The duration of the recorded audio in milliseconds.               | 7.1.0 |
| **uri**      | string | The URI of the recorded audio. Only available on Android and iOS. | 7.0.0 |

### Type Aliases[¶](#type-aliases "Permanent link")

#### PermissionState[¶](#permissionstate "Permanent link")

`'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'`

### Enums[¶](#enums "Permanent link")

#### RecordingStatus[¶](#recordingstatus "Permanent link")

| Members       | Value       | Description                | Since |
| ------------- | ----------- | -------------------------- | ----- |
| **Inactive**  | 'INACTIVE'  | The recording is inactive. | 7.0.0 |
| **Recording** | 'RECORDING' | The recording is active.   | 7.0.0 |
| **Paused**    | 'PAUSED'    | The recording is paused.   | 7.0.0 |

#### AudioSessionCategoryOption[¶](#audiosessioncategoryoption "Permanent link")

| Members                                  | Value                                              | Description                                                                                                                | Since |
| ---------------------------------------- | -------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | ----- |
| **AllowAirPlay**                         | 'ALLOW\_AIR\_PLAY'                                 | Option to stream audio from this session to AirPlay devices.                                                               | 7.5.0 |
| **AllowBluetooth**                       | 'ALLOW\_BLUETOOTH'                                 | Option to make Bluetooth hands-free devices appears as available input routes.                                             | 7.5.0 |
| **AllowBluetoothA2DP**                   | 'ALLOW\_BLUETOOTH\_A2DP'                           | Option to stream audio from this session to Bluetooth devices that support the Advanced Audio Distribution Profile (A2DP). | 7.5.0 |
| **DefaultToSpeaker**                     | 'DEFAULT\_TO\_SPEAKER'                             | Option to make audio from this session to default to the built-in speaker instead of the receiver.                         | 7.5.0 |
| **DuckOthers**                           | 'DUCK\_OTHERS'                                     | Option to reduce the audio volume of other active sessions when audio from this session is in play.                        | 7.5.0 |
| **InterruptSpokenAudioAndMixWithOthers** | 'INTERRUPT\_SPOKEN\_AUDIO\_AND\_MIX\_WITH\_OTHERS' | Option to pause spoken audio of other sessions when audio from this session is in play.                                    | 7.5.0 |
| **MixWithOthers**                        | 'MIX\_WITH\_OTHERS'                                | Option to mix audio with audio from other active sessions in other apps.                                                   | 7.5.0 |
| **overrideMutedMicrophoneInterruption**  | 'OVERRIDE\_MUTED\_MICROPHONE\_INTERRUPTION'        | Option that indicates if the system interrupts the audio session when it mutes the built-in microphone.                    | 7.5.0 |

#### AudioSessionMode[¶](#audiosessionmode "Permanent link")

| Members            | Value              | Description                                                                   | Since |
| ------------------ | ------------------ | ----------------------------------------------------------------------------- | ----- |
| **Default**        | 'DEFAULT'          | Default mode that doesn't enable additional audio session features.           | 7.4.0 |
| **GameChat**       | 'GAME\_CHAT'       | Mode for chat communication over VoIP or internet, optimized for low latency. | 7.4.0 |
| **Measurement**    | 'MEASUREMENT'      | Mode for high-quality measurement recordings with maximum dynamic range.      | 7.4.0 |
| **SpokenAudio**    | 'SPOKEN\_AUDIO'    | Mode for speech recording and transcription with optimized voice processing.  | 7.4.0 |
| **VideoChat**      | 'VIDEO\_CHAT'      | Mode for two-way video chat communications.                                   | 7.4.0 |
| **VideoRecording** | 'VIDEO\_RECORDING' | Mode for recording video content with high-quality audio.                     | 7.4.0 |
| **VoiceChat**      | 'VOICE\_CHAT'      | Mode for voice chat communications.                                           | 7.4.0 |

## Troubleshooting[¶](#troubleshooting "Permanent link")

##### `recordingError` event fires with "An unknown error occurred." and the recording file is 0 bytes[¶](#recordingerror-event-fires-with-an-unknown-error-occurred-and-the-recording-file-is-0-bytes "Permanent link")

This typically happens when an incompatible combination of `bitRate` and `sampleRate` is passed to `startRecording(...)`. The AAC encoder accepts the settings without error at start, but silently fails to encode, producing an empty file and triggering the `recordingError` event on stop.

For example, requesting `bitRate: 256000` with `sampleRate: 16000` (mono AAC) is invalid, because the requested bitrate is far higher than what the encoder can produce from the given sample rate. As a rule of thumb, AAC requires roughly `bitRate <= sampleRate * channels * 6`. Either lower the `bitRate` or raise the `sampleRate` (the default is `44100` Hz, which works with bitrates up to \~256 kbps):

`[](#%5F%5Fcodelineno-19-1)await AudioRecorder.startRecording({
[](#%5F%5Fcodelineno-19-2)  bitRate: 256_000,
[](#%5F%5Fcodelineno-19-3)  sampleRate: 44_100,
[](#%5F%5Fcodelineno-19-4)});
`

## Changelog[¶](#changelog "Permanent link")

See [CHANGELOG.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/audio-recorder/CHANGELOG.md).

## Breaking Changes[¶](#breaking-changes "Permanent link")

See [BREAKING.md](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/audio-recorder/BREAKING.md).

## License[¶](#license "Permanent link")

See [LICENSE](https://github.com/capawesome-team/capacitor-plugins/blob/main/packages/audio-recorder/LICENSE).

May 17, 2026 

 Back to top 