audio

@audio/decode-vorbis1.3.4

Decode Ogg Vorbis audio with libvorbis WASM

Status
calibrated
Updated
Family
decode, 24 packages under it
Category
codecs
Licence
MIT AND BSD-3-Clause AND LGPL-3.0-or-later AND Zlib
Bundles
codec-parser, gpl-3.0, libvorbis, simple-yenc, wasm-audio-decoders
Dependencies
none
Downloads
723,704 last month
Tests
at least 88 in audiojs/decode's CI, passed at 58c36d8,

Decode Ogg Vorbis audio with @wasm-audio-decoders/ogg-vorbis.

import decode, { decoder } from '@audio/decode-vorbis'

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

let dec = await decoder() // initialize WASM
let a = dec.decode(chunk1)
let b = dec.decode(chunk2)
let tail = dec.flush()
dec.free()

decoder() initializes asynchronously. decode() and flush() are synchronous. decode() accepts consecutive complete Ogg files. For chunked input, flush() ends the decoder.

Metadata

Read Vorbis comments and cover art without decoding audio:

import { parseMeta } from '@audio/decode-vorbis/meta'

let { meta, sampleRate } = parseMeta(oggBytes)

License

ॐ · MIT. decode-vorbis.js bundles libvorbis, BSD-3-Clause (LICENSE.libvorbis); codec-parser, LGPL-3.0-or-later (LICENSE.codec-parser); @wasm-audio-decoders, MIT, with puff, zlib (LICENSE.wasm-audio-decoders); simple-yenc, MIT (LICENSE.simple-yenc). The bundled codec-parser is version 2.5.0, and this repository's build.sh builds decode-vorbis.js from src/decode-vorbis.src.js with esbuild, so it can be rebuilt with a modified codec-parser; the GNU GPL that the LGPL-3.0 supplements is in LICENSE.gpl-3.0.