Complete recording lifecycle
Start, pause, resume, stop, cancel and reset audio recordings through a consistent and fully typed API.
A modern and framework-friendly audio recording library for Vue, Nuxt, React and Vanilla TypeScript.
The library provides a framework-independent recording core, fully typed integrations for popular frontend frameworks and ready-to-use recorder components that can be adapted to individual application designs.
jamit-audio-recorder is a modular audio recording solution for modern web applications. The framework-independent core contains the complete recording logic, while dedicated packages provide convenient integrations for Vue, Nuxt and React.
Developers can use the headless API to build a completely custom interface or use ready-to-use Vue and React recorder components with sensible defaults, responsive styling and extensive customization options.
A modular recording foundation with typed APIs, framework integrations, ready-to-use components and reliable browser resource management.
Start, pause, resume, stop, cancel and reset audio recordings through a consistent and fully typed API.
The central recording logic is independent of Vue, React and Nuxt and can also be used directly with Vanilla TypeScript.
Dedicated composables and hooks provide reactive state management, typed recorder actions and automatic lifecycle cleanup for Vue, Nuxt and React.
Use professional recorder components for Vue and React or customize individual areas through props, Vue slots, React render props and CSS variables.
Configure maximum recording duration and maximum file size. Limit violations are exposed through typed error states.
The library checks the formats supported by the current browser, selects an appropriate MIME type and creates the matching file extension.
Completed recordings are available as Blob, File and object URL and can be played back, uploaded or downloaded immediately.
Media streams, timers, object URLs, Web Audio analysis resources and subscriptions are cleaned up reliably, including framework unmounts and React Strict Mode.
A normalized live microphone level between 0 and 1 provides responsive visual feedback while recording, with smoothing, pause handling and automatic cleanup.
Use the ready-to-use recorder component directly in your browser and explore its recording states, live audio level indicator, playback controls and file download.
Start a recording, watch the live microphone level, pause or resume it and play back or download the completed audio file.
The project is structured as a pnpm monorepo with separate packages for the recording core and its framework integrations.
@codeplayer71/audio-recorder-coreFramework-independent TypeScript core containing recording logic, live audio level analysis, browser format detection, state management, recording limits, typed errors and resource cleanup.
@codeplayer71/audio-recorder-vueVue integration with the useAudioRecorder composable and the ready-to-use JamItAudioRecorder component.
@codeplayer71/audio-recorder-reactReact integration with the useAudioRecorder hook and the ready-to-use JamItAudioRecorder component, including Strict Mode-safe lifecycle handling.
@codeplayer71/audio-recorder-nuxtNuxt module that automatically provides useAudioRecorder, registers JamItAudioRecorder and includes the default component styles.
Install only the package required by your application.
pnpm add @codeplayer71/audio-recorder-corepnpm add @codeplayer71/audio-recorder-vuepnpm add @codeplayer71/audio-recorder-nuxtpnpm add @codeplayer71/audio-recorder-reactInstall the framework package required by your application or use the framework-independent core directly.
Use the framework integration that matches your application or work directly with the framework-independent core.
Vue applications can use the ready-to-use JamItAudioRecorder component with its built-in live audio level indicator or build a custom interface with the useAudioRecorder composable.
<script setup lang="ts">
import { JamItAudioRecorder } from '@codeplayer71/audio-recorder-vue';
import '@codeplayer71/audio-recorder-vue/style.css';
</script>
<template>
<JamItAudioRecorder />
</template>Register the Nuxt module once to make the recorder component, composable and default styles available throughout the application, including live audio level support.
export default defineNuxtConfig({
modules: ['@codeplayer71/audio-recorder-nuxt'],
});<template>
<JamItAudioRecorder />
</template>The module automatically imports useAudioRecorder, registers JamItAudioRecorder and includes the default Vue component styles.
React applications can use the ready-to-use JamItAudioRecorder component with its built-in live audio level indicator or build a custom interface with the useAudioRecorder hook.
import { JamItAudioRecorder } from '@codeplayer71/audio-recorder-react';
import '@codeplayer71/audio-recorder-react/style.css';
export function Recorder() {
return <JamItAudioRecorder />;
}The framework-independent core can be used directly in any browser application without Vue, React or another frontend framework.
import { createAudioRecorder } from '@codeplayer71/audio-recorder-core';
const recorder = createAudioRecorder({
maxDurationMs: 120_000,
maxFileSizeBytes: 10_000_000,
});
const unsubscribe = recorder.subscribe((snapshot) => {
console.log(snapshot.state);
console.log(snapshot.durationMs);
console.log(snapshot.recording);
console.log(snapshot.error);
});
await recorder.start();
const recording = await recorder.stop();
console.log(recording.file);
console.log(recording.url);
unsubscribe();
recorder.destroy();The ready-to-use components are optional. Applications that require a completely individual interface can work directly with the Vue composable, React hook or framework-independent core API.
Each integration exposes the current recorder snapshot, normalized live audio level, duration, completed recording, typed errors and the complete set of recording actions.
const {
snapshot,
start,
pause,
resume,
stop,
cancel,
reset,
} = useAudioRecorder();The ready-to-use Vue and React components provide a professional and responsive interface without forcing applications to use a fixed visual style.
Labels, recording limits, browser constraints and visible interface areas such as the live audio level indicator can be configured through typed component props.
<JamItAudioRecorder
title="Record a voice message"
start-label="Start"
stop-label="Finish"
download-label="Save recording"
:max-duration-ms="60_000"
:max-file-size-bytes="5_000_000"
:show-cancel="false"
/>Colors, spacing, border radii, icon sizes and audio level indicator styling can be customized without replacing the component structure.
.custom-recorder {
--jamit-recorder-background: #0f172a;
--jamit-recorder-color: #ffffff;
--jamit-recorder-primary: #2dd4bf;
--jamit-recorder-primary-hover: #14b8a6;
--jamit-recorder-border-radius: 20px;
--jamit-recorder-button-radius: 10px;
--jamit-recorder-spacing: 28px;
--jamit-recorder-icon-size: 20px;
}<JamItAudioRecorder class="custom-recorder" />Individual sections of the Vue component can be replaced through named slots while the recording state and actions remain available.
<JamItAudioRecorder>
<template #header>
<h2>Voice message</h2>
</template>
<template #controls="{ start, stop, isRecording }">
<button
v-if="!isRecording"
type="button"
@click="start"
>
Record
</button>
<button
v-else
type="button"
@click="stop"
>
Finish
</button>
</template>
</JamItAudioRecorder>Available slots include the header, status, duration, audio level, controls, error message, player, download action and footer. The React component provides equivalent customization through render props, including renderAudioLevel.
Audio recording is based on the browser MediaRecorder API. The resulting format depends on the MIME types supported by the browser, operating system and device.
Chromium-based browsers commonly create WebM files with the Opus codec, while Safari commonly provides MP4 audio. Firefox may provide Ogg or WebM depending on the available browser support.
The library does not simply rename recorded files. It checks supported formats at runtime and assigns the matching MIME type and file extension.
The recording core, direct Vanilla TypeScript usage, Vue and React integrations, ready-to-use recorder components and the Nuxt module are fully functional and ready for production use.
The project includes typed APIs, live audio level monitoring, framework-specific lifecycle handling, browser-aware format selection, configurable recording limits, reliable resource cleanup, automated tests and comprehensive documentation for installation, usage and customization.
The complete source code, package implementations, examples, documentation and release history are available in the public GitHub repository.