snac
Multi-Scale Neural Audio Codec
What it is and what it does
SNAC is a neural audio codec that encodes audio into hierarchical discrete tokens at low bitrate. It follows the architecture of SoundStream, EnCodec, and DAC but uses coarse tokens sampled at lower frequency to cover broader time spans, reducing bitrate while enabling long-context audio modeling—for example, 2048 coarse tokens at ~10 Hz can represent ~3 minutes of audio structure.
The package provides pretrained models for speech (24 kHz, 0.98 kbps) and music/sound effects (32 kHz and 44 kHz, 1.9–2.6 kbps). It depends on torch, numpy, einops, and huggingface-hub to load models. Encoding and decoding are straightforward: load a model, call encode() on audio tensors, and retrieve a list of token sequences at different resolutions.
Use it for:
- Compress speech or music into discrete tokens for downstream language model training on audio.
- Reduce audio bitrate for storage or transmission while preserving perceptual quality.
- Generate audio using discrete token sequences in a language modeling framework.
- Reconstruct audio from encoded tokens for real-time or batch audio processing pipelines.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
SNAC compresses audio into discrete hierarchical tokens at low bitrate, enabling efficient audio representation for neural codecs and language modeling approaches to audio generation.
Yes, if you need neural audio compression for language modeling or token-based audio generation and can work with mono audio on GPU. The low install friction and established model zoo make it straightforward to integrate. However, verify the license before production use, and note that maintenance is dormant—expect no active updates, though the package is stable and has no known vulnerabilities.
Install
snac on PyPI
pip
pip install snacuv
uv add snacpoetry
poetry add snacInstalling snac
Before you install
Low install friction with a pure Python wheel. Maintenance is dormant (last commit 2024-11-19, 702 days since release), but the package remains archived=false and has accumulated 774 stars, suggesting stable prior adoption.
License in practice
License treatment is unclear—no SPDX identifier or raw license text is available in the package metadata. Verify the actual license before using in proprietary or copyleft-sensitive contexts.
Quickstart
pip install snac
import torch
from snac import SNAC
model = SNAC.from_pretrained("hubertsiuzdak/snac_32khz").eval().cuda()
audio = torch.randn(1, 1, 32000).cuda()
with torch.inference_mode():
codes = model.encode(audio)
audio_hat = model.decode(codes)
Requires CUDA-capable GPU and torch installed; audio input shape is (batch, channels=1, samples); codes is a list of token sequences at different temporal resolutions.
Verify before relying
- Actual license identifier and terms—metadata shows 'unclear' treatment with no SPDX or raw license field.
- Python version compatibility—requires_python is unspecified in metadata.
- Whether models support stereo or multi-channel audio beyond the documented mono-only constraint.
Package facts
| License | not declared (unclear) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — torch, numpy, einops, huggingface-hub |
| Maintenance | dormant — 702 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 272,475/month — #8,209 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: snac-1.2.1-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
descript-audio-codecCompresses audio into discrete codes at 8 kbps…
permissive · top 15,000 on PyPI
encodecEnCodec is a neural audio codec that compresses…
noncommercial · top 15,000 on PyPI
laion-clapExtracts learned audio and text embeddings…
permissive · top 15,000 on PyPI
panns-inferenceProvides pretrained neural network models for…
permissive · top 15,000 on PyPI
vocosVocos is a neural vocoder that synthesizes…
unclear · top 15,000 on PyPI
s3tokenizerConverts audio into discrete semantic speech…
permissive · top 15,000 on PyPI
silk-pythonEncodes and decodes audio in SILK format, a…
permissive · top 15,000 on PyPI
openunmixSeparates music into individual stems (vocals,…
permissive · top 15,000 on PyPI
mlx-audioMLX-Audio provides text-to-speech,…
permissive · top 15,000 on PyPI
music-assistant-modelsProvides shared data models for Music…
permissive · top 15,000 on PyPI