# recorder-js

> Record audio in your browser

Latest version **1.0.7** (published 2017-05-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install recorder-js
pnpm add recorder-js
yarn add recorder-js
bun add recorder-js
```

## Health

**Score 18/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2017-05-07 |
| First published | 2017-05-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/recorder-js) |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 35 |
| Author | Isaac Snow |
| Maintainers | ijsnow |

## Links

- npm: https://www.npmjs.com/package/recorder-js
- Repository: https://github.com/ijsnow/studiojs
- Homepage: https://github.com/ijsnow/studiojs#readme
- Issues: https://github.com/ijsnow/studiojs/issues
- npm.io page: https://npm.io/package/recorder-js

## Dependencies (1)

- [inline-worker](https://npm.io/package/inline-worker.md) ^1.1.0

## Recent versions

- 1.0.7 (latest) — 2017-05-07
- 1.0.6 — 2017-05-04
- 1.0.5 — 2017-05-04
- 1.0.4 — 2017-05-04
- 1.0.3 — 2017-05-04
- 1.0.2 — 2017-05-04
- 1.0.1 — 2017-05-04
- 1.0.0 — 2017-05-03

## README

# Recorder.js

An easy to use audio recorder with on Matt Diamond's
[recorderjs](https://github.com/mattdiamond/Recorderjs) at the core.

## Installation

```
yarn add recorder-js # or npm install recorder-js --save
```

## Usage

```javascript
import Recorder from 'recorder-js';

const audioContext =  new (window.AudioContext || window.webkitAudioContext)();

const recorder = new Recorder(audioContext, {
  // An array of 255 Numbers
  // You can use this to visualize the audio stream
  // If you use react, check out react-wave-stream
  onAnalysed: data => console.log(data),
});

let isRecording = false;
let blob = null;

navigator.mediaDevices.getUserMedia({audio: true})
  .then(stream => recorder.init(stream))
  .catch(err => console.log('Uh oh... unable to get stream...', err));

function startRecording() {
  recorder.start()
    .then(() => isRecording = true));
}

function stopRecording() {
  recorder.stop()
    .then(({blob, buffer}) => {
      blob = blob;

      // buffer is an AudioBuffer
    }));
}

function download() {
  Recorder.download(blob, 'my-audio-file'); // downloads a .wav file
}
```

### Cool stuff that helped me out

- https://github.com/mattdiamond/Recorderjs
- https://github.com/cwilso/AudioRecorder
- https://codepen.io/zapplebee/pen/gbNbZE

---
_Source: https://npm.io/package/recorder-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
