Skip to main content

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

pip install codecpod

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, and libclang.
  • 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:

uvx maturin develop --release

Or produce a wheel:

uvx maturin build --release

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_DIR environment variable is set, the build skips downloading and uses the sources there directly. See build.rs for the directory layout.

If the CODECPOD_BUILD_DIR environment variable is set, intermediate build artifacts of FFmpeg will be stored in that directory.

Usage

import codecpod
import numpy as np

# Read audio metadata
info = codecpod.info("input.flac")
print(info.sample_rate, info.channels, info.frames, info.codec)

# Decode audio; returns (ndarray, sample_rate) by default, with channels_first=True
waveform, sample_rate = codecpod.load("input.flac")

# Resample to 16 kHz and downmix to mono while decoding
waveform, sample_rate = codecpod.load(
    "input.flac",
    sample_rate=16000,
    mono=True,
)

# Encode to MP3 with explicit encoder parameters
codecpod.save(
    "output.mp3",
    waveform,
    sample_rate,
    codec=codecpod.Mp3(bit_rate=192000),
)

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.

Metadata

Release files for codecpod 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for codecpod 0.3.0
File Size Uploaded Provenance Actions
codecpod-0.3.0.tar.gz 88.8 kB With provenance Details for codecpod-0.3.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for codecpod 0.3.0
File Actions
codecpod-0.3.0-cp314-cp314t-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64 Details for codecpod-0.3.0-cp314-cp314t-manylinux_2_28_x86_64.whl
codecpod-0.3.0-cp314-cp314t-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64 Details for codecpod-0.3.0-cp314-cp314t-macosx_11_0_arm64.whl
codecpod-0.3.0-cp314-cp314t-macosx_10_13_x86_64.whl CPython 3.14 CPython 3.14 free-threading macOS 10.13+ x86-64 Details for codecpod-0.3.0-cp314-cp314t-macosx_10_13_x86_64.whl
codecpod-0.3.0-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details for codecpod-0.3.0-cp38-abi3-win_amd64.whl
codecpod-0.3.0-cp38-abi3-manylinux_2_28_x86_64.whl CPython 3.8 abi3 Linux glibc 2.28+ x86-64 Details for codecpod-0.3.0-cp38-abi3-manylinux_2_28_x86_64.whl
codecpod-0.3.0-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details for codecpod-0.3.0-cp38-abi3-macosx_11_0_arm64.whl
codecpod-0.3.0-cp38-abi3-macosx_10_13_x86_64.whl CPython 3.8 abi3 macOS 10.13+ x86-64 Details for codecpod-0.3.0-cp38-abi3-macosx_10_13_x86_64.whl

Total release size: 27.9 MB

Release files / codecpod-0.3.0.tar.gz

Download URL codecpod-0.3.0.tar.gz
Size 88.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b133d14657d69330190e4e7d2136fcd8c6317f87c7699b3d4e6696d10e693d88
BLAKE2b-256 checksum
How to use checksums
7436f17420532aaebdaecad9294317fa8a84051c82b229601653e41f3ee3c02d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 1, 2026.

Transparency log

Release files / codecpod-0.3.0-cp314-cp314t-manylinux_2_28_x86_64.whl

Download URL codecpod-0.3.0-cp314-cp314t-manylinux_2_28_x86_64.whl
Size 4.2 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
17be40320c1680858d07a7af64820e528c1d2fa4c0d8f17a0ea3a19a5c5d7f92
BLAKE2b-256 checksum
How to use checksums
63693de7cad8130c436e0a92cf9bd71b260879197bae5a03a2902c1f9909a2d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 1, 2026.

Transparency log

Release files / codecpod-0.3.0-cp314-cp314t-macosx_11_0_arm64.whl

Download URL codecpod-0.3.0-cp314-cp314t-macosx_11_0_arm64.whl
Size 3.5 MB
Tags CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3b9967ee72342b1ad07fc065b67b9d1d8f05ccbc8146ea87d375ffc665baed57
BLAKE2b-256 checksum
How to use checksums
620122bf8d81508cbe5fbbb945056df22714df196ac715283c16505b89bac84a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 1, 2026.

Transparency log

Release files / codecpod-0.3.0-cp314-cp314t-macosx_10_13_x86_64.whl

Download URL codecpod-0.3.0-cp314-cp314t-macosx_10_13_x86_64.whl
Size 3.6 MB
Tags CPython 3.14 CPython 3.14 free-threading macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
6db701a5894bb8efc714c308f15fb1c639b92b8d598ce5400e23de0a57d0a636
BLAKE2b-256 checksum
How to use checksums
78441ac244e6d22226e2826d99e1068bdf1ed0753bf4e50c0592190befdb54c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 1, 2026.

Transparency log

Release files / codecpod-0.3.0-cp38-abi3-win_amd64.whl

Download URL codecpod-0.3.0-cp38-abi3-win_amd64.whl
Size 5.0 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
0bbbae242e60eeeb8748934b5008f0fe3c196a212982779b425538aee3289a87
BLAKE2b-256 checksum
How to use checksums
21d5508c00173b1f2880e66515d8708c65e5d4f9769bb8a50649d49fd5c60582
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 1, 2026.

Transparency log

Release files / codecpod-0.3.0-cp38-abi3-manylinux_2_28_x86_64.whl

Download URL codecpod-0.3.0-cp38-abi3-manylinux_2_28_x86_64.whl
Size 4.2 MB
Tags CPython 3.8 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
6e4485033240263b50a05bcbd833c31a576d1f0aca2609b276028e306f4a7f5e
BLAKE2b-256 checksum
How to use checksums
e98b72662458020816b0ad1cfc79654491750d99ee40912bbfbd3734d8545316
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 1, 2026.

Transparency log

Release files / codecpod-0.3.0-cp38-abi3-macosx_11_0_arm64.whl

Download URL codecpod-0.3.0-cp38-abi3-macosx_11_0_arm64.whl
Size 3.6 MB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
27079c44165f5187b604915225032b2ab4a27a9ce08b1881661609a2daf54ce3
BLAKE2b-256 checksum
How to use checksums
371a5746eb7dd28ebd20bc72b507a7420b3f934f006667f0971e227b57171349
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 1, 2026.

Transparency log

Release files / codecpod-0.3.0-cp38-abi3-macosx_10_13_x86_64.whl

Download URL codecpod-0.3.0-cp38-abi3-macosx_10_13_x86_64.whl
Size 3.6 MB
Tags CPython 3.8 abi3 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
aaebc3010cf11a77ab0cee003e48f31fdd57ad899163d6ae50b19306bf83dd04
BLAKE2b-256 checksum
How to use checksums
aacb757795d4cde13839167202143d71f65b163081859908aeff9a25df5b2514
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 1, 2026.

Transparency log

Security for codecpod 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 8 files in this release have been uploaded with provenance metadata.

Select from 8 files

Attestation for codecpod-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page