skillfed

snac

Multi-Scale Neural Audio Codec

snac v1.2.1 272.5K downloads/30d#8,209 on PyPI774
License unclear DORMANT released

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 snac

uv

uv add snac

poetry

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 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

audio codec neural compressiondiscrete audio tokenshierarchical audio encodinglow bitrate audio compressionaudio tokenization for language models
audio-codecneural-compressiontokenization

More Artificial Intelligence packages

Further reading