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.2.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.2.1
File Size Uploaded Provenance Actions
codecpod-0.2.1.tar.gz 82.1 kB With provenance Details for codecpod-0.2.1.tar.gz

Built distributions (wheels)

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

Total release size: 27.8 MB

Release files / codecpod-0.2.1.tar.gz

Download URL codecpod-0.2.1.tar.gz
Size 82.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2b4dc662f9bf0510a50ae286a9427a5cd4d309ac463a85a033524c42547ac795
BLAKE2b-256 checksum
How to use checksums
6008c13f726a4f8919f92c36ecf642e9936e83c1b3aae04cb1d75880481be033
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 29, 2026.

Transparency log

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

Download URL codecpod-0.2.1-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
373edb3b1944244c131b046124a425d4d66587b203fb81e5cee47a07a4c4cf8e
BLAKE2b-256 checksum
How to use checksums
04cfb8906a2bdc0d2c8541a8c9bac6394d0fdc2d128dc25de77bc10c3a91e667
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 29, 2026.

Transparency log

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

Download URL codecpod-0.2.1-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
500c7c39968b7fca83a39d3add4a980b0985c192e8b7678b4cd82bcf320f8a2c
BLAKE2b-256 checksum
How to use checksums
d910cbda79fcf8fa60d7fc9af04889151628014175bbb069e55454e2035fa439
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 29, 2026.

Transparency log

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

Download URL codecpod-0.2.1-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
a11c8fccc4ae1dee4412c946b023454122fff30434a7c63c4cabcd7d02e5499a
BLAKE2b-256 checksum
How to use checksums
2ff5cc228c319cbd151898f472f5df1af25c35e030dc1c7099ebd75d3bfa66b3
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 29, 2026.

Transparency log

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

Download URL codecpod-0.2.1-cp38-abi3-win_amd64.whl
Size 5.0 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
b5d012e51edefe43924780284242dcc04ef19dea0447d2bc060236c08e33146d
BLAKE2b-256 checksum
How to use checksums
687557a5feedc29360b3b86c8bbf59ea571a17eef17200566bb1c9a34f6ce261
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 29, 2026.

Transparency log

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

Download URL codecpod-0.2.1-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
b3b8b399f768eb22fc7f26ca7e936850cbcf35d6f48bc19eeda759a292704ab2
BLAKE2b-256 checksum
How to use checksums
d3e3c696dbeaf0b5553e78120a896ad98742285418c53012a2b0ebd0564d5295
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 29, 2026.

Transparency log

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

Download URL codecpod-0.2.1-cp38-abi3-macosx_11_0_arm64.whl
Size 3.5 MB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8c63a3e99e4d2554b39e0f83689c3043fb055c2a42f12274dbc7f7f18c8cd9d4
BLAKE2b-256 checksum
How to use checksums
c4f074904e38d1ef2ebfe9e203a0e00e4ee11bdca9c07609e3903878cb31e78c
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 29, 2026.

Transparency log

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

Download URL codecpod-0.2.1-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
4f4cd93becdede63d30b4408ca05f20ed4c532f300e973ec7acb2ae15d402c77
BLAKE2b-256 checksum
How to use checksums
29bfe2303aa9f30bba182d4b2c14643e803c196fb795d5b412e5ce76cf4e582c
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 29, 2026.

Transparency log

Security for codecpod 0.2.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.2.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 Jun 29, 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