npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@scr2em/capacitor-plugin-recorder

v0.0.8

Published

record audios and play them back

Readme

capacitor-plugin-recorder

ee

Install

npm install capacitor-plugin-recorder
npx cap sync

API

requestPermission()

requestPermission() => Promise<PermissionStatus>

Request microphone permission

Returns: Promise<PermissionStatus>


checkPermission()

checkPermission() => Promise<PermissionStatus>

Check current permission status

Returns: Promise<PermissionStatus>


startRecord(...)

startRecord(options?: StartRecordOptions | undefined) => Promise<StartRecordResult>

Start recording audio. Returns a recorderId that must be used for all subsequent operations on this recorder.

| Param | Type | | ------------- | ----------------------------------------------------------------- | | options | StartRecordOptions |

Returns: Promise<StartRecordResult>


stopRecord(...)

stopRecord(options: RecorderOptions) => Promise<StopRecordResult>

Stop recording and return the recorded file path

| Param | Type | | ------------- | ----------------------------------------------------------- | | options | RecorderOptions |

Returns: Promise<StopRecordResult>


pauseRecord(...)

pauseRecord(options: RecorderOptions) => Promise<void>

Pause the current recording

| Param | Type | | ------------- | ----------------------------------------------------------- | | options | RecorderOptions |


resumeRecord(...)

resumeRecord(options: RecorderOptions) => Promise<void>

Resume a paused recording

| Param | Type | | ------------- | ----------------------------------------------------------- | | options | RecorderOptions |


preparePlay(...)

preparePlay(options: PlayOptions) => Promise<PreparePlayResult>

Prepare an audio file for playback (loads metadata without playing). Returns a playerId that must be used for all subsequent operations on this player.

| Param | Type | | ------------- | --------------------------------------------------- | | options | PlayOptions |

Returns: Promise<PreparePlayResult>


play(...)

play(options: PlayerOptions) => Promise<void>

Start playing an audio file

| Param | Type | | ------------- | ------------------------------------------------------- | | options | PlayerOptions |


pausePlay(...)

pausePlay(options: PlayerOptions) => Promise<void>

Pause audio playback

| Param | Type | | ------------- | ------------------------------------------------------- | | options | PlayerOptions |


resumePlay(...)

resumePlay(options: PlayerOptions) => Promise<void>

Resume paused audio playback

| Param | Type | | ------------- | ------------------------------------------------------- | | options | PlayerOptions |


stopPlay(...)

stopPlay(options: PlayerOptions) => Promise<void>

Stop audio playback

| Param | Type | | ------------- | ------------------------------------------------------- | | options | PlayerOptions |


seekTo(...)

seekTo(options: SeekOptions) => Promise<void>

Seek to a specific position in the audio

| Param | Type | | ------------- | --------------------------------------------------- | | options | SeekOptions |


getPlaybackStatus(...)

getPlaybackStatus(options: PlayerOptions) => Promise<PlaybackStatusChangeEvent>

Get current playback status for a specific player

| Param | Type | | ------------- | ------------------------------------------------------- | | options | PlayerOptions |

Returns: Promise<PlaybackStatusChangeEvent>


getRecordingStatus(...)

getRecordingStatus(options: RecorderOptions) => Promise<RecordingStatusChangeEvent>

Get current recording status for a specific recorder

| Param | Type | | ------------- | ----------------------------------------------------------- | | options | RecorderOptions |

Returns: Promise<RecordingStatusChangeEvent>


destroyRecorder(...)

destroyRecorder(options: RecorderOptions) => Promise<void>

Destroy a recorder and release its resources

| Param | Type | | ------------- | ----------------------------------------------------------- | | options | RecorderOptions |


destroyPlayer(...)

destroyPlayer(options: PlayerOptions) => Promise<void>

Destroy a player and release its resources

| Param | Type | | ------------- | ------------------------------------------------------- | | options | PlayerOptions |


addListener('recordingStatusChange', ...)

addListener(eventName: 'recordingStatusChange', listenerFunc: (event: RecordingStatusChangeEvent) => void) => Promise<PluginListenerHandle>

Listen for recording status changes

| Param | Type | | ------------------ | ----------------------------------------------------------------------------------------------------- | | eventName | 'recordingStatusChange' | | listenerFunc | (event: RecordingStatusChangeEvent) => void |

Returns: Promise<PluginListenerHandle>


addListener('playbackStatusChange', ...)

addListener(eventName: 'playbackStatusChange', listenerFunc: (event: PlaybackStatusChangeEvent) => void) => Promise<PluginListenerHandle>

Listen for playback status changes (includes playerId to identify which player)

| Param | Type | | ------------------ | --------------------------------------------------------------------------------------------------- | | eventName | 'playbackStatusChange' | | listenerFunc | (event: PlaybackStatusChangeEvent) => void |

Returns: Promise<PluginListenerHandle>


removeAllListeners()

removeAllListeners() => Promise<void>

Remove all listeners


Interfaces

PermissionStatus

| Prop | Type | | ---------------- | ---------------------------------------------- | | microphone | 'granted' | 'denied' | 'prompt' |

StartRecordResult

| Prop | Type | Description | | ---------------- | ------------------- | -------------------------------------------- | | recorderId | string | Unique identifier for this recorder instance |

StartRecordOptions

| Prop | Type | Description | | ---------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | | path | string | Optional relative path for the recording (including extension), relative to the app's data directory. If not provided, a default filename will be used. |

StopRecordResult

| Prop | Type | Description | | ---------------- | ------------------- | ----------------------------------------- | | recorderId | string | The recorder ID | | path | string | Path to the recorded file | | duration | number | Duration of the recording in milliseconds |

RecorderOptions

| Prop | Type | Description | | ---------------- | ------------------- | ----------------------------------------- | | recorderId | string | The recorder ID returned from startRecord |

PreparePlayResult

| Prop | Type | Description | | -------------- | ------------------- | ------------------------------------------ | | playerId | string | Unique identifier for this player instance | | duration | number | Duration of the audio in milliseconds |

PlayOptions

| Prop | Type | Description | | ---------- | ------------------- | ------------------------------------------------------------------------------ | | path | string | Relative path to the audio file to play (relative to the app's data directory) |

PlayerOptions

| Prop | Type | Description | | -------------- | ------------------- | --------------------------------------- | | playerId | string | The player ID returned from preparePlay |

SeekOptions

| Prop | Type | Description | | -------------- | ------------------- | --------------------------------------- | | playerId | string | The player ID returned from preparePlay | | position | number | Position to seek to in milliseconds |

PlaybackStatusChangeEvent

| Prop | Type | Description | | --------------------- | --------------------------------------------------------- | ------------------------------------------- | | playerId | string | The player ID this event belongs to | | status | PlaybackStatus | | | currentPosition | number | Current playback position in milliseconds | | duration | number | Total duration of the audio in milliseconds |

RecordingStatusChangeEvent

| Prop | Type | Description | | ---------------- | ----------------------------------------------------------- | ------------------------------------------ | | recorderId | string | The recorder ID this event belongs to | | status | RecordingStatus | | | duration | number | Current recording duration in milliseconds |

PluginListenerHandle

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

Type Aliases

PlaybackStatus

'playing' | 'paused' | 'stopped' | 'ended'

RecordingStatus

'recording' | 'paused' | 'stopped'