# recorder-mp3

> Aplicacao que permite gravar o audio de browsers diretamente no formato audio/mpeg

Latest version **1.0.0** (published 2023-06-19) · ISC license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-06-19 |
| First published | 2023-06-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | poli.digital |
| Maintainers | edupoli |

## Links

- npm: https://www.npmjs.com/package/recorder-mp3
- npm.io page: https://npm.io/package/recorder-mp3

## Dependencies (1)

- [lamejs](https://npm.io/package/lamejs.md) ^1.2.1

## Recent versions

- 1.0.0 (latest) — 2023-06-19

## README

# Microphone Recorder to Mp3

Record your microphone audio input and get an ```audio/mpeg``` file in the end.

# Install

## Yarn

```bash
yarn add mic-recorder
```

## npm

```bash
npm install mic-recorder
```

# Development

- Watch for changes:

```bash
npm run watch
```

- Regular build:

```bash
npm run build
```

# How to use

```js
const MicRecorder = require('mic-recorder-to-mp3');

// New instance
const recorder = new MicRecorder({
  bitRate: 128
});

// Start recording. Browser will request permission to use your microphone.
recorder.start().then(() => {
  // something else
}).catch((e) => {
  console.error(e);
});

// Once you are done singing your best song, stop and get the mp3.
recorder
.stop()
.getMp3().then(([buffer, blob]) => {
  // do what ever you want with buffer and blob
  // Example: Create a mp3 file and play
  const file = new File(buffer, 'me-at-thevoice.mp3', {
    type: blob.type,
    lastModified: Date.now()
  });

  const player = new Audio(URL.createObjectURL(file));
  player.play();

}).catch((e) => {
  alert('We could not retrieve your message');
  console.log(e);
});
```

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