# modplayer

> Amiga MOD player

Latest version **0.0.7** (published 2022-11-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install modplayer
pnpm add modplayer
yarn add modplayer
bun add modplayer
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2022-11-18 |
| First published | 2022-11-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 87.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Alasdair McLeay |
| Maintainers | penx |
| Keywords | mod, amiga, music, tracker, protracker, player |

## Links

- npm: https://www.npmjs.com/package/modplayer
- Repository: https://github.com/penx/modplayer
- Homepage: https://github.com/penx/modplayer#readme
- Issues: https://github.com/penx/modplayer/issues
- npm.io page: https://npm.io/package/modplayer

## Dependencies (3)

- [@types/audioworklet](https://npm.io/package/@types/audioworklet.md) ^0.0.35
- [@typescript-eslint/parser](https://npm.io/package/@typescript-eslint/parser.md) ^5.43.0
- [@typescript-eslint/eslint-plugin](https://npm.io/package/@typescript-eslint/eslint-plugin.md) ^5.43.0

## Alternatives

- [react-native-root-siblings](https://npm.io/package/react-native-root-siblings.md) — 102.9K weekly downloads
- [@praxisui/dialog](https://npm.io/package/@praxisui/dialog.md) — 2.0K weekly downloads
- [easy-toggle-state](https://npm.io/package/easy-toggle-state.md) — 350 weekly downloads
- [ngx-lightbox-evp](https://npm.io/package/ngx-lightbox-evp.md) — 19 weekly downloads
- [react-native-modal-translucent-axton](https://npm.io/package/react-native-modal-translucent-axton.md) — 4 weekly downloads

## Recent versions

- 0.0.7 (latest) — 2022-11-18
- 0.0.6 — 2022-11-18
- 0.0.5 — 2022-11-18
- 0.0.4 — 2022-11-16
- 0.0.3 — 2022-11-16
- 0.0.2 — 2022-11-16
- 0.0.1 — 2022-11-16

## README

# modplayer

TypeScript mod player/tracker.

## Usage

### AudioWorklet

```ts
import modplayerWorkletUrl from "modplayer/worklet?worker&url";
import { loadWorkletFromBuffer, loadBufferFromUrl } from "modplayer";

const context = new AudioContext({
  sampleRate: 44100,
});
await context.audioWorklet.addModule(modplayerWorkletUrl);
const addModulePromise = context.audioWorklet.addModule(modplayerWorkletUrl);
const { buffer, ext } = await loadBufferFromUrl("/assets/cooltune.mod");
const worklet = loadWorkletFromBuffer(ext, buffer, context, {
    options: {
    autoplay: true,
    repeat: true,
  },
});

worklet.connect(context.destination);
```

[CodeSandbox example](https://codesandbox.io/s/modplayer-example-67p37i)

## Credits

Based upon @electronoora's [webaudio-mod-player](https://github.com/electronoora/webaudio-mod-player).

Forked by Alasdair McLeay:

- Converted to TypeScript
- Published to npm
- Added AudioWorklet (threading) support

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