0.2.1 • Published 4 years ago

wav-web-audio-recorder v0.2.1

Weekly downloads
11
License
Apache-2.0
Repository
github
Last release
4 years ago

wav-web-audio-recorder

This is a fork of @gkt/microphone with different default configs and promises as returns

only records in mono and does not downsample.

@gkt/microphone is a JavaScript library for recording audio via the WebAudio API.

Installation

$ yarn add wav-web-audio-recorder

or

$ npm install wav-web-audio-recorder

Usage

import Recorder from "wav-web-audio-recorder";

navigator.mediaDevices.getUserMedia({ audio: true }).then((stream) => {
  const recorder = new Recorder(stream);

  // start recording audio from the microphone
  recorder
    .start()
    .then(() => {
      //do something
    })
    .catch((error) => {
      //do something
    });

  // periodically export a Blob containing WAV data of the audio recorded since the last export
  recorder
    .export()
    .then((blob) => {
      // do something
    })
    .catch((error) => {
      // do something
    });

  // stop recording audio
  recorder
    .stop()
    .then(() => {
      //do something
    })
    .catch((error) => {
      //do something
    });
});

Publishing

To publish a new version, update the version field in the package.json file and run:

$ npm publish --access public

This will automatically apply a git tag matching the version and push it.

0.2.1

4 years ago

0.2.0

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.9

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago