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

@audio/caf-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/caf-decode

Decode CAF (Core Audio Format) audio to PCM samples

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
3
Created
Source

caf-decode

Decode Core Audio Format (CAF) audio to PCM float samples.

Part of audio-decode.

Install

npm i @audio/caf-decode

Usage

import decode from '@audio/caf-decode'

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

Streaming

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

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

API

decode(src): Promise<AudioData>

Whole-file decode. Accepts Uint8Array or ArrayBuffer.

decoder(): Promise<CAFDecoder>

Creates a decoder instance.

  • dec.decode(data) — decode chunk, returns { channelData, sampleRate }
  • dec.flush() — flush (returns empty — CAF is stateless)
  • dec.free() — release resources

Formats

  • lpcm — 8, 16, 24, 32-bit signed integer (LE/BE), 32/64-bit float (LE/BE)
  • alaw — G.711 A-law
  • ulaw — G.711 mu-law

License

MIT

Keywords

caf

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