encodec
High fidelity neural audio codec
What it is and what it does
EnCodec is a neural audio compression system that encodes audio into discrete codes at very low bitrates. It provides two pre-trained models: a causal 24 kHz model for mono audio and a non-causal 48 kHz model for stereo audio, each supporting multiple target bitrates. The codec can compress to 1.5, 3, 6, 12, or 24 kbps depending on the model, and includes an optional language model that can achieve up to 40% additional compression through entropy coding.
The package is designed for research and non-commercial use. It operates as both a command-line tool for direct audio compression and decompression, and a Python API for extracting discrete audio representations. Models are automatically downloaded via Torch Hub on first use. Installation requires Python 3.8 and a recent PyTorch version, making it a heavy dependency for projects that do not already use deep learning frameworks.
Use it for:
- Research on neural audio compression and discrete audio representations for machine learning.
- Compressing audio archives to very low bitrates for storage in non-commercial settings.
- Extracting discrete codes from audio for use as input to downstream models.
- Comparing audio quality at different compression levels via the command-line interface.
- Prototyping audio codec improvements using the provided MS-STFT discriminator code.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
EnCodec is a neural audio codec that compresses audio to low bitrates while preserving high fidelity, with separate models for 24 kHz mono and 48 kHz stereo audio.
Yes, if you are conducting research on audio compression or need discrete audio codes for a non-commercial pipeline and can manage PyTorch as a dependency. No, if you need commercial licensing, active maintenance, or a lightweight codec for production systems. The noncommercial license and dormant maintenance status are the primary constraints.
Install
encodec on PyPI
pip
pip install encodecuv
uv add encodecpoetry
poetry add encodecInstalling encodec
Before you install
High install friction: requires Python 3.8 and PyTorch 1.11.0 or later. Maintenance is dormant—last release was 2022-10-25 and repository has not been updated since 2024-01-04, so expect no active bug fixes or dependency updates.
License in practice
Licensed under CC-BY-NC 4.0 (noncommercial). You may use this package for research and personal projects, but commercial applications require explicit permission.
Quickstart
pip install encodec
from encodec import EncodecModel
from encodec.utils import convert_audio
model = EncodecModel.encodec_model_24khz()
model.set_target_bandwidth(6.0)
encoded_frames = model.encode(wav)
Requires Python 3.8, PyTorch 1.11.0 or later, and external audio libraries; models auto-download via Torch Hub on first use.
Verify before relying
- Whether PyTorch installation complexity or GPU requirements pose practical barriers for typical users.
- Real-world audio quality trade-offs at different bitrates compared to other codecs.
- Whether the 40% additional compression from the language model is reliable across audio types.
- Actual runtime dependencies beyond what the package metadata declares.
Package facts
| License | Creative Commons Attribution-NonCommercial 4.0 International (noncommercial) |
| Python support | supports the current Python release (>=3.8.0) |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | dormant — 1,389 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 322,834/month — #7,607 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: encodec-0.1.1.tar.gz
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
snacSNAC compresses audio into discrete…
unclear · top 15,000 on PyPI
vocosVocos is a neural vocoder that synthesizes…
unclear · top 15,000 on PyPI
resemble-perthEmbeds imperceptible watermarks into audio…
permissive · top 15,000 on PyPI
pcodecPcodec compresses and decompresses numerical…
unclear · top 15,000 on PyPI
opuslib-nextProvides Python bindings to libopus, the IETF…
permissive · top 15,000 on PyPI
opuslibProvides Python bindings to libopus, the IETF…
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
numcodecsNumcodecs provides buffer compression and…
permissive · top 5,000 on PyPI