audio

@audio/decode-gsm0.1.0

Decode GSM 06.10 full rate audio

Decode GSM 06.10 full rate audio (libgsm WASM)

Status
pending calibration
Updated
Family
decode, 24 packages under it
Category
codecs
Licence
MIT AND TU-Berlin-2.0
Bundles
libgsm
Dependencies
none
Downloads
5,399 last month
Tests
at least 88 in audiojs/decode's CI, passed at 58c36d8,

Decode GSM 06.10 full-rate speech (13 kbit/s, 8 kHz mono) to PCM float samples, with libgsm 1.0.22 (Jutta Degener and Carsten Bormann, TU Berlin) compiled to WASM.

Install

Usage

import decode from '@audio/decode-gsm'

let { channelData, sampleRate } = await decode(gsmBytes)   // 8000 Hz, mono

The input is raw frames, 33 bytes each, 160 samples from each: SoX's .gsm, RTP payload type 3. Raw frames carry no header, so nothing detects them: name the format.

Streaming

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

let dec = await decoder()
let { channelData } = dec.decode(chunk)   // bytes split anywhere: whole frames as they complete
dec.free()

Tested

Sample for sample the output of SoX 14.4.2 (its libgsm) and of FFmpeg 8.0.1's own decoder, on a fixture SoX encoded.

License

MIT; libgsm under its own permissive notice (in LICENSE.libgsm).