New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@audio/amr-decode

Package Overview
Dependencies
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@audio/amr-decode

Decode AMR-NB/WB audio via opencore-amr WASM

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
3
Created
Source

amr-decode

Decode AMR-NB and AMR-WB audio to PCM float samples. opencore-amr compiled to WASM — works in Node.js and browsers.

Part of audio-decode.

Install

npm i @audio/amr-decode

Usage

import decode from '@audio/amr-decode'

// AMR-NB or AMR-WB — auto-detected from file header
let { channelData, sampleRate } = await decode(amrBuffer)
// AMR-NB: 8000 Hz mono
// AMR-WB: 16000 Hz mono

Streaming

import { decoder } from '@audio/amr-decode'

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

API

decode(src): Promise<AudioData>

Whole-file decode. Accepts Uint8Array or ArrayBuffer. Auto-detects AMR-NB (#!AMR\n) vs AMR-WB (#!AMR-WB\n).

decoder(): Promise<AMRDecoder>

Creates a decoder instance.

  • dec.decode(data) — decode chunk, returns { channelData, sampleRate }
  • dec.flush() — flush (returns empty)
  • dec.free() — release WASM memory

Formats

  • AMR-NB — 8 kHz, modes 0–7 (4.75–12.2 kbps)
  • AMR-WB — 16 kHz, modes 0–8 (6.6–23.85 kbps)

Building WASM

The WASM binary is prebuilt in src/amr.wasm.cjs. To rebuild:

npm run build

This auto-fetches opencore-amr 0.1.6 source and compiles with Emscripten.

License

Apache-2.0 (opencore-amr) — krishnized

Keywords

amr

FAQs

Package last updated on 15 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts