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

@audio/aac-decode

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@audio/aac-decode

Decode AAC/M4A audio via FAAD2 WASM

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
3
Created
Source

aac-decode

Decode AAC/M4A audio to PCM float samples. FAAD2 compiled to WASM — works in Node.js and browsers, no native dependencies.

Install

npm i @audio/aac-decode

Usage

import decode from '@audio/aac-decode'

// M4A or raw ADTS — auto-detected
let { channelData, sampleRate } = await decode(uint8array)
// channelData: Float32Array[] (one per channel)
// sampleRate: number

Streaming

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

let dec = await decoder()
let { channelData, sampleRate } = dec.decode(chunk)
dec.free()

API

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

Whole-file decode. Auto-detects M4A (MP4 container) vs raw ADTS.

decoder(): Promise<AACDecoder>

Creates a decoder instance for manual control.

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

AudioData

{ channelData: Float32Array[], sampleRate: number }

Formats

  • M4A / MP4 with AAC audio
  • Raw ADTS streams (.aac)
  • LC, HE-AAC v1/v2 (SBR, PS)

License

GPL-2.0 (FAAD2) — krishnized

Keywords

aac

FAQs

Package last updated on 16 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