Home

Awesome

stbvorbis_sync.js

An ES6, synchronous port of stbvorbis.js. Suitable for use in the AudioWorkletGlobalScope.

Originally ported for use with SpessaSynth.

Usage

Download stbvorbis_sync.js. Copy stbvorbis_sync.js to your desired destination.

To use, import it like this:

import { stbvorbis } from "./stbvorbis_sync.js"

API

decode

stbvorbis.decode(buf: ArrayBuffer|Uint8Array)

decode decodes the given Ogg/Vorbis data.

The return value is an object, formatted like this

namedescription
dataAn array of Float32Array that represents decoded stream for each channel.
sampleRateThe sample rate like 44100.
eofTrue if the stream ends, otherwise false. If this is true, data is null.
errorAn error string if exists, otherwise null.