# @audio/decode-wma

> Decode WMA audio via RockBox WASM

Latest version **1.3.1** (published 2026-08-27) · GPL-2.0-or-later license · 0 weekly downloads

## Install

```sh
npm install @audio/decode-wma
pnpm add @audio/decode-wma
yarn add @audio/decode-wma
bun add @audio/decode-wma
```

## Health

**Score 70/100 (B)** — status: active.

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.3.1 |
| Published | 2026-08-27 |
| First published | 2026-04-04 |
| Weekly downloads | 0 |
| License | GPL-2.0-or-later |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18 |
| Dependencies | 0 |
| Unpacked size | 90 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 208 |
| Author | audiojs |
| Maintainers | jamen, dfcreative, dy |
| Keywords | wma, windows-media-audio, asf, audio, decode, decoder, wasm, rockbox |

## Links

- npm: https://www.npmjs.com/package/@audio/decode-wma
- Repository: https://github.com/audiojs/decode
- Homepage: https://github.com/audiojs/decode/tree/master/packages/decode-wma#readme
- Issues: https://github.com/audiojs/decode/issues
- Funding: https://github.com/sponsors/audiojs
- npm.io page: https://npm.io/package/@audio/decode-wma

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.3.1 (latest) — 2026-08-27
- 1.3.0 — 2026-08-11
- 1.2.3 — 2026-07-14
- 1.2.2 — 2026-07-11
- 1.2.1 — 2026-07-10
- 1.2.0 — 2026-07-10
- 1.1.2 — 2026-04-18
- 1.1.1 — 2026-04-11
- 1.1.0 — 2026-04-05
- 1.0.0 — 2026-04-04

## README

# @audio/decode-wma

Decode WMA audio to PCM float samples. The package combines a pure-JS ASF demuxer with the [RockBox](https://www.rockbox.org/) fixed-point decoder compiled to WASM.

## Install

```
npm i @audio/decode-wma
```

## Usage

```js
import decode from '@audio/decode-wma'

let { channelData, sampleRate } = await decode(wmaBuffer)
```

### Streaming

```js
import { decoder } from '@audio/decode-wma'

let dec = await decoder()
let result = dec.decode(chunk)
dec.free()
```

`decoder()` is asynchronous. Its `decode()` and `flush()` methods are synchronous.

### ASF demuxer only

```js
import { demuxASF } from '@audio/decode-wma'

let { channels, sampleRate, bitRate, packets } = demuxASF(buffer)
```

## API

### `decode(src): Promise<AudioData>`

Whole-file decode. Accepts `Uint8Array` or `ArrayBuffer`.

### `decoder(): Promise<WMADecoder>`

Creates a decoder instance.

- `dec.decode(data)`: decode a `Uint8Array` or `ArrayBuffer` chunk.
- `dec.flush()`: decode a buffered variable-size packet or return an empty result.
- `dec.free()`: release WASM memory.

### `demuxASF(buf): ASFInfo`

Parse ASF container without decoding. Returns stream properties and raw packets.

## Formats

- WMA v1 (0x0160)
- WMA v2 (0x0161)

WMA Pro and Lossless are not supported. An FFmpeg-based build is available via `build-ffmpeg.sh` for those formats.

## Building WASM

```
npm run build
```

RockBox source is included in `lib/rockbox-wma/` (3 files, 152 KB).

## License

[ॐ](https://github.com/krishnized/license/) · [GPL-2.0+](./LICENSE) (RockBox)

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