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.

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

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.1.2
File Size Uploaded Provenance Actions
codecpod-0.1.2.tar.gz 82.0 kB With provenance Details for codecpod-0.1.2.tar.gz

Built distributions (wheels)

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

Total release size: 27.7 MB

Release files / codecpod-0.1.2.tar.gz

Download URL codecpod-0.1.2.tar.gz
Size 82.0 kB
Tags Source
SHA-256 checksum
How to use checksums
402e1b580713771a27361a10dd32694ad2205e7661b0278c5e011f97b0bb696f
BLAKE2b-256 checksum
How to use checksums
68c67a97cb75d9f4135bbadcd5d6f794412ea18e50daae600793dc541b71956f
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 Jun 23, 2026.

Transparency log

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

Download URL codecpod-0.1.2-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
fa27c062bdf30b9ac9edb1d11eb2b85c4954661899bce14f4737426236cfda48
BLAKE2b-256 checksum
How to use checksums
0b9baf70a8341565779ccccf75d84130735d6f26add9f61f21b103566d2355cb
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 Jun 23, 2026.

Transparency log

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

Download URL codecpod-0.1.2-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
d0b23158aa0d439e602d7d6bdcf3aa05070ffcb741e07325e5eeef5e13e0c4b4
BLAKE2b-256 checksum
How to use checksums
d5f3e8706c80f591ff812949d3b9b1c585ef83a49f112ef131036c0f5b59fdd7
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 Jun 23, 2026.

Transparency log

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

Download URL codecpod-0.1.2-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
bd6a9a527930693224af7225653d6f1e3a722d6b7435ee7a1a70181eccc73d9f
BLAKE2b-256 checksum
How to use checksums
211adee211adb9b457ea36878f3795140d3ebeb13a85cdd28f792806229797a5
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 Jun 23, 2026.

Transparency log

Release files / codecpod-0.1.2-cp37-abi3-win_amd64.whl

Download URL codecpod-0.1.2-cp37-abi3-win_amd64.whl
Size 5.0 MB
Tags CPython 3.7 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
47e95dab40f4e451d42cf91c6263e56285947a8fe21ae0f0e5bd089d7a113ebf
BLAKE2b-256 checksum
How to use checksums
5d1f55d32ea1b03591f3a5fe0680f1863a9247dcfd74ff38d91cb1726f152753
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 Jun 23, 2026.

Transparency log

Release files / codecpod-0.1.2-cp37-abi3-manylinux_2_28_x86_64.whl

Download URL codecpod-0.1.2-cp37-abi3-manylinux_2_28_x86_64.whl
Size 4.2 MB
Tags CPython 3.7 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
381886b9612c9798dc6da5fad660e74c1896db17340b23ed059fd73a99add5cd
BLAKE2b-256 checksum
How to use checksums
2bf9837843fcf4eaf1aa48c7618b937ad0fd9fed607df547d35d90b07df33443
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 Jun 23, 2026.

Transparency log

Release files / codecpod-0.1.2-cp37-abi3-macosx_11_0_arm64.whl

Download URL codecpod-0.1.2-cp37-abi3-macosx_11_0_arm64.whl
Size 3.5 MB
Tags CPython 3.7 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
dda1ed726a95c60de72f3fb3dbe46978c3e904e21df788c9d64ce0189483aefd
BLAKE2b-256 checksum
How to use checksums
a33330b8ad20c40e18dc7954b4a3443f016fbce555eaf2db925cf9f288bcd51f
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 Jun 23, 2026.

Transparency log

Release files / codecpod-0.1.2-cp37-abi3-macosx_10_13_x86_64.whl

Download URL codecpod-0.1.2-cp37-abi3-macosx_10_13_x86_64.whl
Size 3.6 MB
Tags CPython 3.7 abi3 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
9a81b5ee05092937e8d995635a74c80edd3b862fad45319170518692ea0f8843
BLAKE2b-256 checksum
How to use checksums
88c459a5742cd66e00a5b73fe0b23d40a75d9d260ef4e5838ddcf257515f8ea9
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 Jun 23, 2026.

Transparency log

Security for codecpod 0.1.2

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.1.2.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 Jun 23, 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