# @audio/decode-dts

> Decode DTS (DTS Coherent Acoustics core) audio with libdca WASM

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

## Install

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

## 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.0.0 |
| Published | 2026-08-27 |
| First published | 2026-08-27 |
| Weekly downloads | 0 |
| License | GPL-2.0-or-later |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18 |
| Dependencies | 0 |
| Unpacked size | 228.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 209 |
| Author | audiojs |
| Maintainers | jamen, dfcreative, dy |
| Keywords | dts, dts, dca, coherent acoustics, surround, 5.1, audio, decode, decoder, wasm, libdca |

## Links

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

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2026-08-27

## README

# @audio/decode-dts

Decode DTS (DTS Coherent Acoustics) to PCM float samples.<br>
[libdca](https://code.videolan.org/videolan/libdca) compiled to a single-file WASM ES module — no side files, loads from any CDN, Node, workers and AudioWorklets.

[![npm install @audio/decode-dts](https://nodei.co/npm/@audio/decode-dts.png?mini=true)](https://npmjs.org/package/@audio/decode-dts/)

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

let { channelData, sampleRate } = await decode(dtsBytes)

let dec = await decoder()
let head = dec.decode(chunk1)   // synchronous; partial frames carry over
let tail = dec.flush()
dec.free()
```

Input is a raw DTS core frame stream (`.dts`, or the frames a container demuxer extracts — [@audio/decode-mp4](../decode-mp4), [@audio/decode-webm](../decode-webm) and [@audio/decode-avi](../decode-avi) route their DTS tracks here). The stream's own layout is kept, up to 5.1; channels come out in WAV order: FL, FR, FC, LFE, BL, BR (surround-only or mono as present). Output level is full scale,  

DTS-HD Master Audio and High Resolution streams decode through their lossy core; the extension substreams are skipped. 14-bit and little-endian sync variants are handled.

## API

### `decode(src: Uint8Array | ArrayBuffer): Promise<AudioData>`

Decode a complete stream.

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

Synchronous streaming decoder: `decode(chunk)` returns the samples of every complete frame in the data so far, `flush()` drops a trailing partial frame, `free()` releases WASM memory. `errors` counts frames that failed to decode.

### `AudioData`

```ts
{ channelData: Float32Array[], sampleRate: number }
```

## License

[ॐ](https://github.com/krishnized/license/) · [GPL-2.0-or-later](./LICENSE), inherited from the bundled [libdca](./LICENSE.libdca).

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