@bigear/microphone-recorder

It is a lib for sound recording on HTML, implemented by audioContext and webWorker

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
20Aug 14, 2018Jul 31, 2018Minified + gzip package size for @bigear/microphone-recorder in KB

Readme

microphone-recorder

It is a lib for sound recording on HTML, implemented by audioContext and webWorker

npm-img npm-url

nodei.co

Install

$ npm install --save @bigear/microphone-recorder

Demo

Github: https://github.com/vue-exp-lab/vue-sound-streaming/blob/master/src/pages/MicAudioContext.vue

Usage


import Recorder from "@bigear/microphone-recorder";


navigator.mediaDevices.getUserMedia({ audio: true }).then((mediaStreamObject) => {
    const input = audio_context.createMediaStreamSource(mediaStreamObject);

    const recorder = new Recorder(input);
    recorder.record();

    // speak for a bit
    recorder.stop();
    recorder.exportWAV("audio/wav", function(blob) {
        // append the audio blob to html element
        const url = URL.createObjectURL(AudioBLOB);
        const au = document.querySelector("audio");
        au.controls = true;
        au.src = url;
        recorder.clear();
    });
})

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.