zero dependency
uses browser's api MediaDevices.getUserMedia()
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();