---
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/sdks/capacitor/audio-recorder.png
---

<!doctype html> 

[Skip to content ](#capacitor-audio-recorder-plugin) 

[🔐 Introducing the **Capacitor Vault** plugin — store secrets behind biometrics or a device passcode. ](/blog/announcing-the-capacitor-vault-plugin/) 

* [ SDKs ](/docs/sdks/)
* [ iOS ](#ios)
* [ Configuration ](#configuration)
* [ Usage ](#usage)
* [ API ](#api)
* [ Type Aliases ](#type-aliases)
* [ Enums ](#enums)
* [ Troubleshooting ](#troubleshooting)
* [ FAQ ](#faq)
* [ Related Plugins ](#related-plugins)
* [ Newsletter ](#newsletter)
* [ Changelog ](#changelog)
* [ Breaking Changes ](#breaking-changes)
* [ License ](#license)
* [ Audio Session ](/docs/sdks/capacitor/audio-session/)
* [ Background Task ](/docs/sdks/capacitor/background-task/)
* [ Badge ](/docs/sdks/capacitor/badge/)
* [ Barometer ](/docs/sdks/capacitor/barometer/)
* [ Battery ](/docs/sdks/capacitor/battery/)
* [ Biometrics ](/docs/sdks/capacitor/biometrics/)
* [ Bluetooth Low Energy ](/docs/sdks/capacitor/bluetooth-low-energy/)
* [ Clipboard ](/docs/sdks/capacitor/clipboard/)
* [ Cloudinary ](/docs/sdks/capacitor/cloudinary/)
* [ Compass ](/docs/sdks/capacitor/compass/)
* [ Contacts ](/docs/sdks/capacitor/contacts/)
* [ Datetime Picker ](/docs/sdks/capacitor/datetime-picker/)
* [ Device Info ](/docs/sdks/capacitor/device-info/)
* [ Dialog ](/docs/sdks/capacitor/dialog/)
* [ Exif ](/docs/sdks/capacitor/exif/)
* [ Facebook Sign-In ](/docs/sdks/capacitor/facebook-sign-in/)
* [ File Compressor ](/docs/sdks/capacitor/file-compressor/)
* [ File Opener ](/docs/sdks/capacitor/file-opener/)
* [ File Picker ](/docs/sdks/capacitor/file-picker/)
* [ Firebase ](/docs/sdks/capacitor/firebase/)
* [ Formbricks ](/docs/sdks/capacitor/formbricks/)
* [ Geocoder ](/docs/sdks/capacitor/geocoder/)
* [ Google Sign-In ](/docs/sdks/capacitor/google-sign-in/)
* [ Grafana Faro ](/docs/sdks/capacitor/grafana-faro/)
* [ Gyroscope ](/docs/sdks/capacitor/gyroscope/)
* [ Haptics ](/docs/sdks/capacitor/haptics/)
* [ Home Indicator ](/docs/sdks/capacitor/home-indicator/)
* [ In-App Browser ](/docs/sdks/capacitor/in-app-browser/)
* [ Install Referrer ](/docs/sdks/capacitor/install-referrer/)
* [ Keep Awake ](/docs/sdks/capacitor/keep-awake/)
* [ libSQL ](/docs/sdks/capacitor/libsql/)
* [ Light Sensor ](/docs/sdks/capacitor/light-sensor/)
* [ Live Update ](/docs/sdks/capacitor/live-update/)
* [ Localization ](/docs/sdks/capacitor/localization/)
* [ Mail Composer ](/docs/sdks/capacitor/mail-composer/)
* [ Managed Configurations ](/docs/sdks/capacitor/managed-configurations/)
* [ Maps Launcher ](/docs/sdks/capacitor/maps-launcher/)
* [ Media Session ](/docs/sdks/capacitor/media-session/)
* [ ML Kit ](/docs/sdks/capacitor/mlkit/)
* [ Navigation Bar ](/docs/sdks/capacitor/navigation-bar/)
* [ Network ](/docs/sdks/capacitor/network/)
* [ NFC ](/docs/sdks/capacitor/nfc/)
* [ Node.js ](/docs/sdks/capacitor/nodejs/)
* [ OAuth ](/docs/sdks/capacitor/oauth/)
* [ Passkeys ](/docs/sdks/capacitor/passkeys/)
* [ Password Autofill ](/docs/sdks/capacitor/password-autofill/)
* [ PDF Generator ](/docs/sdks/capacitor/pdf-generator/)
* [ PDF Viewer ](/docs/sdks/capacitor/pdf-viewer/)
* [ Pedometer ](/docs/sdks/capacitor/pedometer/)
* [ Permissions ](/docs/sdks/capacitor/permissions/)
* [ Phone Dialer ](/docs/sdks/capacitor/phone-dialer/)
* [ Photo Editor ](/docs/sdks/capacitor/photo-editor/)
* [ Photo Manipulator ](/docs/sdks/capacitor/photo-manipulator/)
* [ PixLive ](/docs/sdks/capacitor/pixlive/)
* [ PostHog ](/docs/sdks/capacitor/posthog/)
* [ Printer ](/docs/sdks/capacitor/printer/)
* [ Privacy Screen ](/docs/sdks/capacitor/privacy-screen/)
* [ Proximity Sensor ](/docs/sdks/capacitor/proximity-sensor/)
* [ Purchases ](/docs/sdks/capacitor/purchases/)
* [ RealtimeKit ](/docs/sdks/capacitor/realtimekit/)
* [ Root Detection ](/docs/sdks/capacitor/root-detection/)
* [ Screen Brightness ](/docs/sdks/capacitor/screen-brightness/)
* [ Screen Orientation ](/docs/sdks/capacitor/screen-orientation/)
* [ Screen Reader ](/docs/sdks/capacitor/screen-reader/)
* [ Screenshot ](/docs/sdks/capacitor/screenshot/)
* [ Secure Preferences ](/docs/sdks/capacitor/secure-preferences/)
* [ Settings Launcher ](/docs/sdks/capacitor/settings-launcher/)
* [ Shake ](/docs/sdks/capacitor/shake/)
* [ Silent Mode ](/docs/sdks/capacitor/silent-mode/)
* [ SIM ](/docs/sdks/capacitor/sim/)
* [ SMS Composer ](/docs/sdks/capacitor/sms-composer/)
* [ Speech Recognition ](/docs/sdks/capacitor/speech-recognition/)
* [ Speech Synthesis ](/docs/sdks/capacitor/speech-synthesis/)
* [ Share Target ](/docs/sdks/capacitor/share-target/)
* [ Square Mobile Payments ](/docs/sdks/capacitor/square-mobile-payments/)
* [ SQLite ](/docs/sdks/capacitor/sqlite/)
* [ Superwall ](/docs/sdks/capacitor/superwall/)
* [ System WebView ](/docs/sdks/capacitor/system-webview/)
* [ Text Interaction ](/docs/sdks/capacitor/text-interaction/)
* [ Text Zoom ](/docs/sdks/capacitor/text-zoom/)
* [ Thermal State ](/docs/sdks/capacitor/thermal-state/)
* [ Toast ](/docs/sdks/capacitor/toast/)
* [ Torch ](/docs/sdks/capacitor/torch/)
* [ Vault ](/docs/sdks/capacitor/vault/)
* [ Volume ](/docs/sdks/capacitor/volume/)
* [ Wallet ](/docs/sdks/capacitor/wallet/)
* [ Wifi ](/docs/sdks/capacitor/wifi/)
* [ Zip ](/docs/sdks/capacitor/zip/)
* [ Cordova ](/docs/sdks/cordova/)
* [ Cloud ](/docs/cloud/)
* [ Integrations ](/docs/cloud/live-updates/integrations/)
* Concepts
* Reference
* [ Troubleshooting ](/docs/cloud/live-updates/troubleshooting/)
* [ FAQ ](/docs/cloud/live-updates/faq/)
* [ Native Builds ](/docs/cloud/native-builds/)
* [ Set Up Environments ](/docs/cloud/native-builds/environments/)
* [ Overwrite Native Configurations ](/docs/cloud/native-builds/native-configurations/)
* [ Auto-Increment Build Numbers ](/docs/cloud/native-builds/auto-incrementing-build-numbers/)
* [ Configure the Web Build Script ](/docs/cloud/native-builds/web-build-script/)
* [ Build from a Monorepo ](/docs/cloud/native-builds/monorepo/)
* [ Use pnpm, Yarn, or bun ](/docs/cloud/native-builds/package-managers/)
* [ Install Private npm Packages ](/docs/cloud/native-builds/npm-private-registry/)
* [ Override the Java Version ](/docs/cloud/native-builds/override-java-version/)
* [ Custom iOS Provisioning Profiles ](/docs/cloud/native-builds/custom-ios-provisioning-profiles/)
* [ Build without Git ](/docs/cloud/native-builds/build-without-git/)
* [ Access Git Behind a Firewall ](/docs/cloud/native-builds/firewall-access/)
* [ Integrations ](/docs/cloud/native-builds/integrations/)
* Reference
* [ Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [ FAQ ](/docs/cloud/native-builds/faq/)
* [ App Store Publishing ](/docs/cloud/app-store-publishing/)
* [ Submit a Build ](/docs/cloud/app-store-publishing/submit-a-build/)
* [ Submit Automatically After a Build ](/docs/cloud/app-store-publishing/submit-automatically/)
* [ Troubleshooting ](/docs/cloud/app-store-publishing/troubleshooting/)
* [ FAQ ](/docs/cloud/app-store-publishing/faq/)
* [ Automations ](/docs/cloud/automations/)
* [ Reference ](/docs/cloud/automations/reference/)
* [ Troubleshooting ](/docs/cloud/automations/troubleshooting/)
* [ FAQ ](/docs/cloud/automations/faq/)
* [ Assist ](/docs/cloud/assist/)
* [ CLI ](/docs/cloud/cli/)
* APIs and SDKs
* [ Webhooks ](/docs/cloud/webhooks/)
* [ Integrations ](/docs/cloud/integrations/)
* Account
* [ Organization ](/docs/cloud/organizations/)
* [ Two-Factor Enforcement ](/docs/cloud/organizations/two-factor-authentication/)
* [ Audit Logs ](/docs/cloud/organizations/audit-logs/)
* [ Billing ](/docs/cloud/organizations/billing/)
* [ License Keys ](/docs/cloud/license-keys/)
* [ AI ](/docs/ai/)
* [ Insiders ](/docs/insiders/)
* [ Billing & Plans ](/docs/insiders/billing-and-plans/)
* [ FAQ ](/docs/insiders/faq/)
* [ License ](https://capawesome.io/legal/eula/)
* [ Support ](/docs/support/)
* [ Contributing ](/docs/contributing/)
* Contributing code
* [ Code of Conduct ](/docs/contributing/code-of-conduct/)
* [ Questions ](https://docs.github.com/en/discussions/collaborating-with-your-community-using-discussions/participating-in-a-discussion#creating-a-discussion)
* [ Blog ](/blog/)
* Categories

* [ iOS ](#ios)
* [ Configuration ](#configuration)
* [ Usage ](#usage)
* [ API ](#api)
* [ Type Aliases ](#type-aliases)
* [ Enums ](#enums)
* [ Troubleshooting ](#troubleshooting)
* [ FAQ ](#faq)
* [ Related Plugins ](#related-plugins)
* [ Newsletter ](#newsletter)
* [ Changelog ](#changelog)
* [ Breaking Changes ](#breaking-changes)
* [ License ](#license)

# Capacitor Audio Recorder Plugin[¶](#capacitor-audio-recorder-plugin "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")

The Capacitor Audio Recorder plugin is one of the most advanced audio recording solutions for Capacitor apps. 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/sdks/capacitor/audio-player/), [Speech Recognition](https://capawesome.io/docs/sdks/capacitor/speech-recognition/) and [Speech Synthesis](https://capawesome.io/docs/sdks/capacitor/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!

## Use Cases[¶](#use-cases "Permanent link")

The Audio Recorder plugin is typically used whenever an app needs to capture audio with the device's microphone, for example:

* **Voice messages**: Record voice messages in chat apps and play them back with the [Audio Player](https://capawesome.io/docs/sdks/capacitor/audio-player/) plugin.
* **Voice notes and memos**: Let users record notes with full control to pause, resume, or cancel the recording.
* **Dictation and transcription**: Capture spoken audio that is later transcribed, for example by a server-side speech-to-text service.
* **Interviews and long sessions**: Record long audio sessions without performance issues, even while the app is in the background.

## 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")

The following examples show how to manage permissions, start a recording, save it to a custom location, stop and play it back, pause, resume or cancel it, read the recording status, and listen for recording events.

### Check and request permissions[¶](#check-and-request-permissions "Permanent link")

Recording requires the microphone permission. Check and request it before starting a recording:

`[](#%5F%5Fcodelineno-6-1)import { AudioRecorder } from '@capawesome-team/capacitor-audio-recorder';
[](#%5F%5Fcodelineno-6-2)
[](#%5F%5Fcodelineno-6-3)const checkPermissions = async () => {
[](#%5F%5Fcodelineno-6-4)  const { recordAudio } = await AudioRecorder.checkPermissions();
[](#%5F%5Fcodelineno-6-5)  console.log('Record audio permission:', recordAudio);
[](#%5F%5Fcodelineno-6-6)};
[](#%5F%5Fcodelineno-6-7)
[](#%5F%5Fcodelineno-6-8)const requestPermissions = async () => {
[](#%5F%5Fcodelineno-6-9)  const { recordAudio } = await AudioRecorder.requestPermissions();
[](#%5F%5Fcodelineno-6-10)  console.log('Record audio permission:', recordAudio);
[](#%5F%5Fcodelineno-6-11)};
`

### Start a recording[¶](#start-a-recording "Permanent link")

Start recording audio in AAC format. You can optionally configure the bitrate and sample rate (Android and iOS) as well as the audio session category options and mode (iOS only):

`[](#%5F%5Fcodelineno-7-1)import { AudioRecorder, AudioSessionCategoryOption, AudioSessionMode } from '@capawesome-team/capacitor-audio-recorder';
[](#%5F%5Fcodelineno-7-2)
[](#%5F%5Fcodelineno-7-3)const startRecording = async () => {
[](#%5F%5Fcodelineno-7-4)  await AudioRecorder.startRecording({
[](#%5F%5Fcodelineno-7-5)    audioSessionCategoryOptions: [AudioSessionCategoryOption.DuckOthers],
[](#%5F%5Fcodelineno-7-6)    audioSessionMode: AudioSessionMode.Measurement,
[](#%5F%5Fcodelineno-7-7)    bitRate: 192000,
[](#%5F%5Fcodelineno-7-8)    sampleRate: 44100
[](#%5F%5Fcodelineno-7-9)  });
[](#%5F%5Fcodelineno-7-10)};
`

### Save the recording to a custom location[¶](#save-the-recording-to-a-custom-location "Permanent link")

By default, the recording is saved to a temporary location in the cache directory. On Android and iOS, use the `uri` option to save it to a custom location instead, for example one generated with the Capacitor Filesystem plugin:

`[](#%5F%5Fcodelineno-8-1)import { AudioRecorder } from '@capawesome-team/capacitor-audio-recorder';
[](#%5F%5Fcodelineno-8-2)import { Directory, Filesystem } from '@capacitor/filesystem';
[](#%5F%5Fcodelineno-8-3)
[](#%5F%5Fcodelineno-8-4)const startRecordingToCustomLocation = async () => {
[](#%5F%5Fcodelineno-8-5)  const { uri } = await Filesystem.getUri({
[](#%5F%5Fcodelineno-8-6)    directory: Directory.Data,
[](#%5F%5Fcodelineno-8-7)    path: 'recordings/my-recording.aac'
[](#%5F%5Fcodelineno-8-8)  });
[](#%5F%5Fcodelineno-8-9)  await AudioRecorder.startRecording({ uri });
[](#%5F%5Fcodelineno-8-10)};
`

### Stop the recording and play it back[¶](#stop-the-recording-and-play-it-back "Permanent link")

Stop the recording to receive the recorded audio as a `Blob` (Web) or URI (Android and iOS), which you can then play back, for example with the [Audio Player](https://capawesome.io/docs/sdks/capacitor/audio-player/) plugin:

`[](#%5F%5Fcodelineno-9-1)import { AudioRecorder } from '@capawesome-team/capacitor-audio-recorder';
[](#%5F%5Fcodelineno-9-2)import { AudioPlayer } from '@capawesome-team/capacitor-audio-player';
[](#%5F%5Fcodelineno-9-3)
[](#%5F%5Fcodelineno-9-4)const stopRecording = async () => {
[](#%5F%5Fcodelineno-9-5)  // Stop recording and get the audio blob or URI
[](#%5F%5Fcodelineno-9-6)  const { blob, uri } = await AudioRecorder.stopRecording();
[](#%5F%5Fcodelineno-9-7)  // Play the audio
[](#%5F%5Fcodelineno-9-8)  if (blob) {
[](#%5F%5Fcodelineno-9-9)    // Only available on Web
[](#%5F%5Fcodelineno-9-10)    await AudioPlayer.play({ blob });
[](#%5F%5Fcodelineno-9-11)  } else if (uri) {
[](#%5F%5Fcodelineno-9-12)    // Only available on Android and iOS
[](#%5F%5Fcodelineno-9-13)    await AudioPlayer.play({ uri });
[](#%5F%5Fcodelineno-9-14)  }
[](#%5F%5Fcodelineno-9-15)};
`

### Pause, resume or cancel the recording[¶](#pause-resume-or-cancel-the-recording "Permanent link")

Pause a running recording and resume it later, or cancel it to discard the recorded audio. Pausing and resuming is only available on Android (SDK 24+), iOS and Web:

`[](#%5F%5Fcodelineno-10-1)import { AudioRecorder } from '@capawesome-team/capacitor-audio-recorder';
[](#%5F%5Fcodelineno-10-2)
[](#%5F%5Fcodelineno-10-3)const pauseRecording = async () => {
[](#%5F%5Fcodelineno-10-4)  await AudioRecorder.pauseRecording();
[](#%5F%5Fcodelineno-10-5)};
[](#%5F%5Fcodelineno-10-6)
[](#%5F%5Fcodelineno-10-7)const resumeRecording = async () => {
[](#%5F%5Fcodelineno-10-8)  await AudioRecorder.resumeRecording();
[](#%5F%5Fcodelineno-10-9)};
[](#%5F%5Fcodelineno-10-10)
[](#%5F%5Fcodelineno-10-11)const cancelRecording = async () => {
[](#%5F%5Fcodelineno-10-12)  await AudioRecorder.cancelRecording();
[](#%5F%5Fcodelineno-10-13)};
`

### Get the current recording status[¶](#get-the-current-recording-status "Permanent link")

Check whether a recording is currently inactive, active or paused:

`[](#%5F%5Fcodelineno-11-1)import { AudioRecorder } from '@capawesome-team/capacitor-audio-recorder';
[](#%5F%5Fcodelineno-11-2)
[](#%5F%5Fcodelineno-11-3)const getRecordingStatus = async () => {
[](#%5F%5Fcodelineno-11-4)  const { status } = await AudioRecorder.getRecordingStatus();
[](#%5F%5Fcodelineno-11-5)  console.log('Recording status:', status);
[](#%5F%5Fcodelineno-11-6)};
`

### Listen for recording events[¶](#listen-for-recording-events "Permanent link")

Get notified when the recording is paused (e.g. when it is interrupted by a phone call), when it is stopped, or when an error occurs. The `recordingError` event is only available on iOS:

`[](#%5F%5Fcodelineno-12-1)import { AudioRecorder } from '@capawesome-team/capacitor-audio-recorder';
[](#%5F%5Fcodelineno-12-2)
[](#%5F%5Fcodelineno-12-3)const addRecordingErrorListener = async () => {
[](#%5F%5Fcodelineno-12-4)  await AudioRecorder.addListener('recordingError', (event) => {
[](#%5F%5Fcodelineno-12-5)    console.error('Recording error:', event.message);
[](#%5F%5Fcodelineno-12-6)  });
[](#%5F%5Fcodelineno-12-7)};
[](#%5F%5Fcodelineno-12-8)
[](#%5F%5Fcodelineno-12-9)const addRecordingPausedListener = async () => {
[](#%5F%5Fcodelineno-12-10)  await AudioRecorder.addListener('recordingPaused', () => {
[](#%5F%5Fcodelineno-12-11)    console.log('Recording paused');
[](#%5F%5Fcodelineno-12-12)  });
[](#%5F%5Fcodelineno-12-13)};
[](#%5F%5Fcodelineno-12-14)
[](#%5F%5Fcodelineno-12-15)const addRecordingStoppedListener = async () => {
[](#%5F%5Fcodelineno-12-16)  await AudioRecorder.addListener('recordingStopped', (event) => {
[](#%5F%5Fcodelineno-12-17)    console.log('Recording stopped:', event.uri);
[](#%5F%5Fcodelineno-12-18)  });
[](#%5F%5Fcodelineno-12-19)};
`

## 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-13-1)cancelRecording() => Promise<void>
`

Cancel the recording.

**Since:** 7.0.0

---

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

`[](#%5F%5Fcodelineno-14-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-15-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-16-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-17-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-18-1)stopRecording() => Promise<StopRecordingResult>
`

Stop recording audio.

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

**Since:** 7.0.0

---

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

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

Check permissions for audio recording.

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

**Since:** 7.0.0

---

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

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

Request permissions for audio recording.

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

**Since:** 7.0.0

---

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

`[](#%5F%5Fcodelineno-21-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-22-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-23-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-24-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-25-1)await AudioRecorder.startRecording({
[](#%5F%5Fcodelineno-25-2)  bitRate: 256_000,
[](#%5F%5Fcodelineno-25-3)  sampleRate: 44_100,
[](#%5F%5Fcodelineno-25-4)});
`

## FAQ[¶](#faq "Permanent link")

### Which audio format is used for recordings?[¶](#which-audio-format-is-used-for-recordings "Permanent link")

The plugin records audio in AAC format. You can configure the bitrate (default: 192000 bytes per second) and sample rate (default: 44100 Hz) via the options of the `startRecording(...)` method on Android and iOS.

### Can I record audio while the app is in the background?[¶](#can-i-record-audio-while-the-app-is-in-the-background "Permanent link")

Yes, the plugin supports background recording. On iOS, you need to enable the `Background Modes` capability with `Audio, AirPlay, and Picture in Picture` in your Xcode project, as described in the [Installation](#installation) section.

### What permissions are required to record audio?[¶](#what-permissions-are-required-to-record-audio "Permanent link")

The plugin needs access to the device's microphone, which you can check and request using the `checkPermissions()` and `requestPermissions()` methods. On iOS, you also need to add the `NSMicrophoneUsageDescription` key to your `Info.plist` file as described in the [Installation](#installation) section.

### Why is my recording file empty?[¶](#why-is-my-recording-file-empty "Permanent link")

This typically happens when an incompatible combination of `bitRate` and `sampleRate` is passed to `startRecording(...)`. The AAC encoder silently fails to encode, producing an empty file and triggering the `recordingError` event. Either lower the `bitRate` or raise the `sampleRate`. See the [Troubleshooting](#troubleshooting) section for more details.

### Where is the recorded audio saved?[¶](#where-is-the-recorded-audio-saved "Permanent link")

By default, the recording is saved to a temporary location in the cache directory on Android and iOS, and its URI is returned by the `stopRecording()` method. You can save the recording to a custom location instead by passing the `uri` option to `startRecording(...)`. On Web, the recorded audio is returned as a `Blob`.

### Can I use this plugin with Ionic, React, Vue or Angular?[¶](#can-i-use-this-plugin-with-ionic-react-vue-or-angular "Permanent link")

Yes, the plugin is framework-agnostic. It works in any Capacitor app regardless of the web framework, including Ionic with Angular, React, or Vue, as well as plain JavaScript projects.

## Related Plugins[¶](#related-plugins "Permanent link")

* [Audio Player](https://capawesome.io/docs/sdks/capacitor/audio-player/): Play back recorded audio with background support.
* [Speech Recognition](https://capawesome.io/docs/sdks/capacitor/speech-recognition/): Transcribe speech into text (speech-to-text).
* [Speech Synthesis](https://capawesome.io/docs/sdks/capacitor/speech-synthesis/): Synthesize speech from text (text-to-speech).

## 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/).

## 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).

July 8, 2026 

Back to top

```json
{"@context": "https://schema.org", "@graph": [{"@type": "TechArticle", "@id": "https://capawesome.io/docs/sdks/capacitor/audio-recorder/#article", "headline": "Capacitor Audio Recorder Plugin for Android, iOS & Web", "name": "Capacitor Audio Recorder Plugin for Android, iOS & Web", "description": "Capacitor plugin for audio recording using the device's microphone. It supports recording, pausing, and stopping audio sessions.", "inLanguage": "en", "url": "https://capawesome.io/docs/sdks/capacitor/audio-recorder/", "mainEntityOfPage": "https://capawesome.io/docs/sdks/capacitor/audio-recorder/", "author": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}, "publisher": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}, "about": {"@id": "https://capawesome.io/docs/sdks/capacitor/audio-recorder/#software"}}, {"@type": "SoftwareSourceCode", "@id": "https://capawesome.io/docs/sdks/capacitor/audio-recorder/#software", "name": "Capacitor Audio Recorder Plugin for Android, iOS & Web", "description": "Capacitor plugin for audio recording using the device's microphone. It supports recording, pausing, and stopping audio sessions.", "url": "https://capawesome.io/docs/sdks/capacitor/audio-recorder/", "programmingLanguage": "TypeScript", "runtimePlatform": "Capacitor", "codeRepository": "https://github.com/capawesome-team", "author": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}, "publisher": {"@type": "Organization", "name": "Capawesome", "url": "https://capawesome.io", "logo": {"@type": "ImageObject", "url": "https://capawesome.io/assets/images/logo.svg"}}}]}
{"@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [{"@type": "Question", "name": "Which audio format is used for recordings?", "acceptedAnswer": {"@type": "Answer", "text": "The plugin records audio in AAC format. You can configure the bitrate (default: 192000 bytes per second) and sample rate (default: 44100 Hz) via the options of the startRecording(...) method on Android and iOS."}}, {"@type": "Question", "name": "Can I record audio while the app is in the background?", "acceptedAnswer": {"@type": "Answer", "text": "Yes, the plugin supports background recording. On iOS, you need to enable the Background Modes capability with Audio, AirPlay, and Picture in Picture in your Xcode project, as described in the Installation section."}}, {"@type": "Question", "name": "What permissions are required to record audio?", "acceptedAnswer": {"@type": "Answer", "text": "The plugin needs access to the device's microphone, which you can check and request using the checkPermissions() and requestPermissions() methods. On iOS, you also need to add the NSMicrophoneUsageDescription key to your Info.plist file as described in the Installation section."}}, {"@type": "Question", "name": "Why is my recording file empty?", "acceptedAnswer": {"@type": "Answer", "text": "This typically happens when an incompatible combination of bitRate and sampleRate is passed to startRecording(...). The AAC encoder silently fails to encode, producing an empty file and triggering the recordingError event. Either lower the bitRate or raise the sampleRate. See the Troubleshooting section for more details."}}, {"@type": "Question", "name": "Where is the recorded audio saved?", "acceptedAnswer": {"@type": "Answer", "text": "By default, the recording is saved to a temporary location in the cache directory on Android and iOS, and its URI is returned by the stopRecording() method. You can save the recording to a custom location instead by passing the uri option to startRecording(...). On Web, the recorded audio is returned as a Blob."}}, {"@type": "Question", "name": "Can I use this plugin with Ionic, React, Vue or Angular?", "acceptedAnswer": {"@type": "Answer", "text": "Yes, the plugin is framework-agnostic. It works in any Capacitor app regardless of the web framework, including Ionic with Angular, React, or Vue, as well as plain JavaScript projects."}}], "url": "https://capawesome.io/docs/sdks/capacitor/audio-recorder/"}
```
