# @mymusictaste/async-audiorecorder

> node-audiorecorder with async/await & typescript support

Latest version **0.1.1** (published 2023-04-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mymusictaste/async-audiorecorder
pnpm add @mymusictaste/async-audiorecorder
yarn add @mymusictaste/async-audiorecorder
bun add @mymusictaste/async-audiorecorder
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2023-04-15 |
| First published | 2023-04-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 25 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jinhyeok Lee |
| Maintainers | zenyr |

## Links

- npm: https://www.npmjs.com/package/@mymusictaste/async-audiorecorder
- Homepage: https://unpkg.com/@mymusictaste/async-audiorecorder/
- npm.io page: https://npm.io/package/@mymusictaste/async-audiorecorder

## Dependencies (1)

- [node-audiorecorder](https://npm.io/package/node-audiorecorder.md) ^3.0.0

## Recent versions

- 0.1.1 (latest) — 2023-04-15
- 0.1.0 — 2023-04-15
- 0.0.2 — 2023-04-15
- 0.0.1 — 2023-04-15

## README

# @mymusictaste/async-audiorecorder

## Requirements

- Node.js version 16 or later
- sox or arecord installed and available
  - To install sox on macOS, run `brew install sox`
  - For Windows, please search the web for installation instructions.

## What is @mymusictaste/async-audiorecorder?

- This package extends the `node-audiorecorder` module with an awaitable promise.
- It inherits the same caveats as `node-audiorecorder`: it requires `sox`, `rec`, or `arecord` to be installed.
- It automatically injects sensible defaults for the program and audio driver based on the platform (Windows, macOS, or Linux).
- It adds a function to list available audio devices (best effort only!).
  - Uses `rec` on macOS and Windows, and `arecord` on Linux.
  - On Linux, it returns in `plughw:` format. You can replace it with `hw:` on the fly if necessary.
- Please let me know if it doesn't work on your system.

## Why use @mymusictaste/async-audiorecorder?

- `node-audiorecorder` was good enough, but this package provides an await and TypeScript-friendly version of it.
- You can easily await for `recorder.promise()` to get the audio buffer reliably.

## Example usage

```ts
import AudioRecorder from "@mymusictaste/async-audiorecorder";

// ...
const list = await AudioRecorder.availableDevices(); // Returns { device: string, label: string }. Use `device`!
const buffer = await recorder.promise();
```

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