Skip to content

A simple browser recording tool. Functions for simple processing of PCM and WAV data.

License

Notifications You must be signed in to change notification settings

liuw5367/recorder

Repository files navigation

Recorder

A simple browser recording tool. Functions for simple processing of PCM and WAV data.

npm version bundle JSDocs License contributors last-commit issues-commit forks-commit stars-commit

Features

  • Support recording via the browser.
  • Support for specifying recording devices.
  • Functions for simple processing of PCM and WAV data.
  • Support for multi-channel PCM data and WAV conversion.

Getting Started

pnpm add @lw6/recorder

Usage

import { Recorder, getAudioInputDevices } from '@lw6/recorder'

const devices = await getAudioInputDevices();

const recorder = new Recorder({
  numberOfChannels: 1,
  // "undefined" represents using the system default device.
  // deviceId: devices[0].deviceId,
  deviceId: undefined,
})

recorder.open()
    .then(([sampleRate, channels]) => {
      console.log('channels:', channels, 'sampleRate:', sampleRate)
    })
    .catch((error) => {
      alert(error)
    })

recorder.pause();
recorder.resume();

recorder.stop();
recorder.getDuration();

Roadmap

  • Speech To Text

Contributing

License

MIT

Contact

Email: [email protected]

Project Link: https://github.com/liuw5367/recorder