--- id: snac version: "1.2.1" license: unclear license_treatment: unclear maintenance: dormant --- # snac — Multi-Scale Neural Audio Codec License: unclear · Maintenance: dormant · Downloads: 272.5K/mo ## 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 above — 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 pip install snac uv add snac poetry add snac ## Installing 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: unspecified - Install friction: low - Maintenance: dormant - Downloads: 272.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags audio codec neural compression, discrete audio tokens, hierarchical audio encoding, low bitrate audio compression, audio tokenization for language models, audio-codec, neural-compression, tokenization [View on SkillFed](https://skillfed.io/packages/snac) · [View on PyPI](https://pypi.org/project/snac/)