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

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.2.3
File Size Uploaded Provenance Actions
codecpod-0.2.3.tar.gz 88.8 kB With provenance Details for codecpod-0.2.3.tar.gz

Built distributions (wheels)

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

Total release size: 27.9 MB

Release files / codecpod-0.2.3.tar.gz

Download URL codecpod-0.2.3.tar.gz
Size 88.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ef734ed7417533342b04fed88c9b0b0dee6b60b79f1c72b407677a0a575bb436
BLAKE2b-256 checksum
How to use checksums
f9577f9dc019046156466caf67207679b6382fc208d7d5fa0a525b2199bc8f70
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.2.3-cp314-cp314t-manylinux_2_28_x86_64.whl

Download URL codecpod-0.2.3-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
5ff51e0c43baeaf59a800798168d01f353d7c2b13febf4af4ab449521c6d28db
BLAKE2b-256 checksum
How to use checksums
3268751a8b1fff3d7cb11796e9914031cd254d68683c5a38bd977c6fe032184e
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.2.3-cp314-cp314t-macosx_11_0_arm64.whl

Download URL codecpod-0.2.3-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
fa048cddd310bc85b131195ccd36ad2b2b1a97ee57a9d3331609458ef046ed2f
BLAKE2b-256 checksum
How to use checksums
7a8c30c3488628f0ffca094bce8728d69d83bc4567a1bbf1b7d11b9482caa138
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.2.3-cp314-cp314t-macosx_10_13_x86_64.whl

Download URL codecpod-0.2.3-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
08dbddf0571a4ecde494223da1005ec222fb99a8dc4e0d820ccab666d7bfea8b
BLAKE2b-256 checksum
How to use checksums
411bcadf0e14dacfc24caebd7ae4b9f93d5c532b4cc6297c0e370be1fecec439
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.2.3-cp38-abi3-win_amd64.whl

Download URL codecpod-0.2.3-cp38-abi3-win_amd64.whl
Size 5.0 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
72ee6be6b6e17df9c6f84c099d05d3a36a6e41e6c300afb94d7ef9c08e49627f
BLAKE2b-256 checksum
How to use checksums
0acb262c19621edde408731dd66608c8d6d5e336cfb4a7d239e871423902bb83
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.2.3-cp38-abi3-manylinux_2_28_x86_64.whl

Download URL codecpod-0.2.3-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
68955da6ea6d2e9b24e57a94b33ca539718cebfdac2ab19bbf5a4fd20cb23c45
BLAKE2b-256 checksum
How to use checksums
a1b27bee1d1978cd16dc9c95021649ab3bc374726905b2e3d10a6829f5ac1063
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.2.3-cp38-abi3-macosx_11_0_arm64.whl

Download URL codecpod-0.2.3-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
9f5ebbe31fd9a046fdb487c3c9adf878def2a3f931b27002c72ba88bd8667565
BLAKE2b-256 checksum
How to use checksums
092a2970cf7de206466e6e3f33bb208c0828fdcb010c5ae65fb4a84c398f19ab
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.2.3-cp38-abi3-macosx_10_13_x86_64.whl

Download URL codecpod-0.2.3-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
a2988942f6ce86589acb445f977be8430f9eed9f474a426bb3518ba67f0805e7
BLAKE2b-256 checksum
How to use checksums
b5a26f6aa27d8c55319f786517cde839b61e3ac102f6a9a7ec8afa702d998648
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.2.3

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