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

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.1
File Size Uploaded Provenance Actions
codecpod-0.3.1.tar.gz 89.7 kB With provenance Details for codecpod-0.3.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for codecpod 0.3.1
File Actions
codecpod-0.3.1-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.1-cp314-cp314t-manylinux_2_28_x86_64.whl
codecpod-0.3.1-cp314-cp314t-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64 Details for codecpod-0.3.1-cp314-cp314t-macosx_11_0_arm64.whl
codecpod-0.3.1-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.1-cp314-cp314t-macosx_10_13_x86_64.whl
codecpod-0.3.1-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details for codecpod-0.3.1-cp38-abi3-win_amd64.whl
codecpod-0.3.1-cp38-abi3-manylinux_2_28_x86_64.whl CPython 3.8 abi3 Linux glibc 2.28+ x86-64 Details for codecpod-0.3.1-cp38-abi3-manylinux_2_28_x86_64.whl
codecpod-0.3.1-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details for codecpod-0.3.1-cp38-abi3-macosx_11_0_arm64.whl
codecpod-0.3.1-cp38-abi3-macosx_10_13_x86_64.whl CPython 3.8 abi3 macOS 10.13+ x86-64 Details for codecpod-0.3.1-cp38-abi3-macosx_10_13_x86_64.whl

Total release size: 28.4 MB

Release files / codecpod-0.3.1.tar.gz

Download URL codecpod-0.3.1.tar.gz
Size 89.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ae4e880dc1e717b93afa75356fc3f327bd55f932d239d57b8f45aaf1c267f6c0
BLAKE2b-256 checksum
How to use checksums
c99c41c50ceef2c9f71e89e774404fba6a3b603f34cef0ba7a426dcb30c39fb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 9, 2026.

Transparency log

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

Download URL codecpod-0.3.1-cp314-cp314t-manylinux_2_28_x86_64.whl
Size 4.3 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
2cf52a1137329c41063d5a10402e59fdb625619bb4f5f146b4d4977980407bd6
BLAKE2b-256 checksum
How to use checksums
613790f3c4e0775808590e558f004081ad8a3fbeb3dc889e8324222efa24ff8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 9, 2026.

Transparency log

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

Download URL codecpod-0.3.1-cp314-cp314t-macosx_11_0_arm64.whl
Size 3.6 MB
Tags CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3cb054d4054e17ef815a0d38274c2060931799d1baee3cb607bdc8b1daac4a53
BLAKE2b-256 checksum
How to use checksums
eb680e5b5434a6e1442aaeb542c7781725015fdf8cea32784eb05f6e11b7c628
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 9, 2026.

Transparency log

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

Download URL codecpod-0.3.1-cp314-cp314t-macosx_10_13_x86_64.whl
Size 3.7 MB
Tags CPython 3.14 CPython 3.14 free-threading macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
4f297896860477454e3065981d69a5a898e9cb82912f716bccbffcd7f1c74ff4
BLAKE2b-256 checksum
How to use checksums
90750d0d0bc02e2caf7cbb7aad9e63eec63bf3230d3be5e9af2f105641c12d61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 9, 2026.

Transparency log

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

Download URL codecpod-0.3.1-cp38-abi3-win_amd64.whl
Size 5.1 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
2b90983d1d46fae1e89118fdcff80296acfdac5c308f8a3908d85d13e67cb9ef
BLAKE2b-256 checksum
How to use checksums
e26dd583ddc2bab1bd91d0db5f15e1d9ccf2c37d54b091ceeabc41ac036e3d10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 9, 2026.

Transparency log

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

Download URL codecpod-0.3.1-cp38-abi3-manylinux_2_28_x86_64.whl
Size 4.3 MB
Tags CPython 3.8 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
85c33e23f2903352593bedebbd31c84b7f70a48e1bba0c406832c6330cc53d01
BLAKE2b-256 checksum
How to use checksums
72055cd005acbc115b70c84fcfa2295319706240a7fd2ac9e23fa995f4642f93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 9, 2026.

Transparency log

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

Download URL codecpod-0.3.1-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
cad0a830732f0edbc77b72346c05a6073ec0adff0d33a52ad8e03c834013e9a9
BLAKE2b-256 checksum
How to use checksums
11ce9a77c0ff3f74a9ed467ad63a62a6f01b412460c090740682f5d8f6a3b262
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 9, 2026.

Transparency log

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

Download URL codecpod-0.3.1-cp38-abi3-macosx_10_13_x86_64.whl
Size 3.7 MB
Tags CPython 3.8 abi3 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
bd8dcd5d1ace66a56278add46834bd16e229b889af42c3d726a64089bda15414
BLAKE2b-256 checksum
How to use checksums
53b2adbe3a527e0512e8990d229628ed684d18f6fe80cd1bff42db3f628bbc3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 9, 2026.

Transparency log

Security for codecpod 0.3.1

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.1.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 Sep 9, 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