Skip to content

greenkeytech/microphone

Repository files navigation

@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.

About

A JavaScript library for recording audio via the WebAudio API

Resources

License

Stars

Watchers

Forks

Packages

No packages published