Skip to content
This repository has been archived by the owner on Sep 27, 2021. It is now read-only.

Latest commit

 

History

History
43 lines (31 loc) · 1 KB

README.md

File metadata and controls

43 lines (31 loc) · 1 KB
logo

A tiny library for converting browser's audio to WAV/PCM


zero dependency
uses browser's api MediaDevices.getUserMedia()

usage

npm install microphone-js
import { Microphone } from 'microphone-js'

const mic = Microphone();
// const mic = Microphone({ isMono: true, sampleRate: 16000 }); if you yant mono 16KHz, default is stereo 44kHz

mic.start();

mic.stop();

// continue recording
mic.start();

const blob = mic.getBlob();

mic.download();

// reset recording buffer
mic.reset();    

Resources