@lw6/recorder
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

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: liuw5367@gmail.com

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

Package Sidebar

Install

npm i @lw6/recorder

Weekly Downloads

1

Version

0.3.0

License

MIT

Unpacked Size

97.7 kB

Total Files

8

Last publish

Collaborators

  • liuw5367