At a glance
| Upstream model |
hubertsiuzdak/snac_24khz
(19.8M params, Multi-Scale Neural Audio Codec, MIT)
|
|---|---|
| Browser ONNX |
onnx-community/snac_24khz-ONNX
(rev f317cdf)
|
| Task | audio-to-audio (neural audio codec: waveform → 3-tier discrete codes → reconstructed waveform) |
| Runtime |
@huggingface/transformers@3.7.5 (shared pin — SnacModel +
SnacFeatureExtractor running off-thread in a Web Worker)
|
| Audio & tokens |
24,000 Hz mono Float32 [1, 1, N] ↔ 3 × 12-bit (4,096-entry)
int64 codebooks: Coarse 12 Hz (hop 2,048), Mid 24 Hz
(hop 1,024), Fine 48 Hz (hop 512) → 0.984 kbps nominal (~1.01 kbps on 2 s
padded clips). Decoded output is trimmed to exact input length.
|
| Backend & dtype |
WebGPU fp32 (when a GPU adapter is present — 4–14× faster) with automatic
honest fallback to CPU WASM fp32. Both share the exact same
80.26 MB artifacts (encoder_model.onnx 27.66 MB +
decoder_model.onnx 52.60 MB). Why fp32? Live verification proved
fp16 (40.23 MB) attenuates SNAC's Snake1D activations by −6 to −14 dB and degrades
speech intelligibility, while q8 is ~2× slower on WASM with codebook drift.
|
| License | MIT (weights & ONNX export) |
Interactive ~1 kbps Neural Codec Studio
Prepare SNAC 24kHz above to encode and reconstruct audio locally on your device.
3-Tier Multi-Scale Discrete Token Ribbon (12 Hz · 24 Hz · 48 Hz)
SNAC Reconstructed (~1 kbps)
Residual (Original − Reconstructed)
Use-case ladder
Basics · 3-Tier Multi-Scale Token Inspector
Inspect every hierarchical codebook stream (12 Hz Coarse / 24 Hz Mid / 48 Hz Fine) on a high-DPI
token map, measure per-tier utilization & Shannon entropy, import/export raw integer
.json packets, and view the live codec source code.
Practical · Codebook Tier Ablation & Bandwidth Lab
Encode once, then drop individual codebook tiers (~0.98 kbps → ~0.42 kbps →
~0.14 kbps) or inject 0–40% simulated packet loss to hear exactly what
coarse prosody, mid formants, and fine texture carry.
Wild · Token-Space Audio Glitch & Cross-Splice Synthesizer
Encode two different clips and splice Coarse tokens from Clip A with Mid/Fine tokens from Clip B, reverse individual tiers, or bit-crush codebook indices directly in discrete token space.
Multi-model · 1 kbps Codec → Moonshine ASR Intelligibility Benchmark
Chain SNAC 24kHz (~80.3 MB) with the shared Moonshine Base ASR worker (~68 MB) to transcribe both uncompressed and ~1 kbps compressed speech side-by-side and measure live WER preservation.