@gkt/microphone

1.0.3 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @gkt/microphone

Weekly Downloads

109

Version

1.0.3

License

Apache-2.0

Unpacked Size

77.4 kB

Total Files

15

Last publish

Collaborators

  • greenkeytech