Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
codecpod
English | 简体中文
An audio codec library that statically links FFmpeg, avoiding the hassle of pre-installed dependencies. Provides both a Rust API and Python bindings.
Features
- Bundles a static FFmpeg; zero external shared-library dependencies at runtime.
- Decoding: AAC, AC-3, ALAC, APE, FLAC, MP1/2/3, Opus, Vorbis, WavPack, various PCM/ADPCM, and more.
- Encoding: WAV, AIFF, FLAC, ALAC, AAC, MP3 (LAME), Opus, Vorbis.
- Optional resampling, downmixing, range trimming, normalization, and more.
Installation
Pre-built wheels are published to PyPI for Linux x86_64, macOS (Apple Silicon and Intel), and Windows x86_64.
Building from source
Building requires the following toolchain:
- A Rust toolchain; the latest stable is recommended.
nasm,clang, andlibclang.make,pkg-config.
On Windows the FFmpeg sources are built with autotools, so the toolchain must be the GNU
(MinGW-w64) one rather than MSVC: build inside an MSYS2 UCRT64
shell and target x86_64-pc-windows-gnullvm.
Build and install into the current environment:
Or produce a wheel:
The first build downloads the FFmpeg and dependency source tarballs from upstream, pinned to the exact versions and SHA-256 checksums in
build.rs. This takes a while, so make sure your network connection is stable.If the
CODECPOD_VENDOR_DIRenvironment variable is set, the build skips downloading and uses the sources there directly. Seebuild.rsfor the directory layout.
Usage
# Read audio metadata
=
# Decode audio; returns (ndarray, sample_rate) by default, with channels_first=True
, =
# Resample to 16 kHz and downmix to mono while decoding
, =
# Encode to MP3 with explicit encoder parameters
License
Copyright (C) 2026 zhoukz <me@zhoukz.com>
This project is distributed under LGPL-2.1-or-later; see LICENSE.
It statically links several third-party libraries; see
THIRD-PARTY-NOTICES.md for details.