1.0.3 • Published 4 years ago

@gkt/microphone v1.0.3

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

@gkt/microphone

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

Installation

$ npm install @gkt/microphone

Usage

import Microphone from '@gkt/microphone';

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

  // start recording audio from the microphone
  mic.start();

  // periodically export a Blob containing WAV data of the audio recorded since the last export
  const blob = mic.export();

  // stop recording audio
  mic.stop();
});

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.