Skip to main content

Audio codec library backed by a statically-linked, source-built FFmpeg.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codecpod-0.1.0.tar.gz (81.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

codecpod-0.1.0-cp314-cp314t-manylinux_2_28_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ x86-64

codecpod-0.1.0-cp314-cp314t-macosx_11_0_arm64.whl (3.5 MB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

codecpod-0.1.0-cp314-cp314t-macosx_10_13_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.14tmacOS 10.13+ x86-64

codecpod-0.1.0-cp313-cp313t-manylinux_2_28_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.28+ x86-64

codecpod-0.1.0-cp313-cp313t-macosx_11_0_arm64.whl (3.5 MB view details)

Uploaded CPython 3.13tmacOS 11.0+ ARM64

codecpod-0.1.0-cp313-cp313t-macosx_10_13_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.13tmacOS 10.13+ x86-64

codecpod-0.1.0-cp37-abi3-win_amd64.whl (5.0 MB view details)

Uploaded CPython 3.7+Windows x86-64

codecpod-0.1.0-cp37-abi3-manylinux_2_28_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.28+ x86-64

codecpod-0.1.0-cp37-abi3-macosx_11_0_arm64.whl (3.5 MB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

codecpod-0.1.0-cp37-abi3-macosx_10_13_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.7+macOS 10.13+ x86-64

File details

Details for the file codecpod-0.1.0.tar.gz.

File metadata

  • Download URL: codecpod-0.1.0.tar.gz
  • Upload date:
  • Size: 81.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for codecpod-0.1.0.tar.gz
Algorithm Hash digest
SHA256 43dffbbfc7b41645d7110e09b24035b40c4bbb4d6271eb5af4b3e34b13a6bf6e
MD5 e5674736d72825cc2aa5b58d892ec7fd
BLAKE2b-256 c3756b4ce9c12a2031dae57afe6ff71bbaa9ad4598078a0d8d4f7e2ee6d2894e

See more details on using hashes here.

Provenance

The following attestation bundles were made for codecpod-0.1.0.tar.gz:

Publisher: wheels.yml on zhoukezi/codecpod

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codecpod-0.1.0-cp314-cp314t-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for codecpod-0.1.0-cp314-cp314t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d209b501b27cd46ea4d88674a056176ce32c6cdf76334c6128535ce7e315dc5d
MD5 2c4858b01913c2cfdd019ba6af72def0
BLAKE2b-256 ff213c1dc20ab69b062481e033b54e749aabfba448fccd39b0c5d82f5d784ac3

See more details on using hashes here.

Provenance

The following attestation bundles were made for codecpod-0.1.0-cp314-cp314t-manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on zhoukezi/codecpod

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codecpod-0.1.0-cp314-cp314t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for codecpod-0.1.0-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c283a5d2f17a4f1e1f975936cb49883b993e5bef3787de21584931973b7f4256
MD5 8893b1afd4b3c38140b62676498a7be2
BLAKE2b-256 26a1a920b58192ae8d69ddd02f52f6d1861d193d45f912235f1716083f9d91ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for codecpod-0.1.0-cp314-cp314t-macosx_11_0_arm64.whl:

Publisher: wheels.yml on zhoukezi/codecpod

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codecpod-0.1.0-cp314-cp314t-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for codecpod-0.1.0-cp314-cp314t-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 ef37fb614f0a991dd68f6131c2fda21fc516bff857dd6b0e17846372ba9d0a22
MD5 7f5116945ec364bae7c79c986afaf638
BLAKE2b-256 a34fd95d9af20fbaf4cd93f9ce6d6b754c31a78d91bf5ade22b5bf088cf3aacc

See more details on using hashes here.

Provenance

The following attestation bundles were made for codecpod-0.1.0-cp314-cp314t-macosx_10_13_x86_64.whl:

Publisher: wheels.yml on zhoukezi/codecpod

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codecpod-0.1.0-cp313-cp313t-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for codecpod-0.1.0-cp313-cp313t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c68436af4f3fec23701b480a7ab3118e7db0ebf1f28bd080b81348df9399771d
MD5 2bfca71342f902f27448d8b0d5250565
BLAKE2b-256 0d16a522f4b87b9acc504005afee5593550a07c6654060dfdc3447d2e2f0fda1

See more details on using hashes here.

Provenance

The following attestation bundles were made for codecpod-0.1.0-cp313-cp313t-manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on zhoukezi/codecpod

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codecpod-0.1.0-cp313-cp313t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for codecpod-0.1.0-cp313-cp313t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ad82a42c9d97cffe2dcebef66732e50669d07ae078416728b2534457f6d4f006
MD5 820368346602af4a6c33b98943c636bd
BLAKE2b-256 c8ba37a0b209956bbc7394e186bf93ab8d3837ddb968430275a89e89dc85c836

See more details on using hashes here.

Provenance

The following attestation bundles were made for codecpod-0.1.0-cp313-cp313t-macosx_11_0_arm64.whl:

Publisher: wheels.yml on zhoukezi/codecpod

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codecpod-0.1.0-cp313-cp313t-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for codecpod-0.1.0-cp313-cp313t-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 edf7a90b752b6e853e14bd474e6524fd41465350cccc9224d03ae1e473e50712
MD5 12b4fb7ebe0315bb8ad8ecc4a5ad667a
BLAKE2b-256 87a09d4ba5a4504b4ec66b23f6021d2561e02b4c6f2b2690bbcc745effc52aaa

See more details on using hashes here.

Provenance

The following attestation bundles were made for codecpod-0.1.0-cp313-cp313t-macosx_10_13_x86_64.whl:

Publisher: wheels.yml on zhoukezi/codecpod

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codecpod-0.1.0-cp37-abi3-win_amd64.whl.

File metadata

  • Download URL: codecpod-0.1.0-cp37-abi3-win_amd64.whl
  • Upload date:
  • Size: 5.0 MB
  • Tags: CPython 3.7+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for codecpod-0.1.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 08aea2f2a89fd17a346b29b50243f9f33ac9d908c016d8e7dea9fc9b0b863cb9
MD5 563e7b72b44dea9768e7a08b69092714
BLAKE2b-256 2476d17be545ec374cc57d65df24c94169798c248dadf1bd7231aec7004efb6b

See more details on using hashes here.

Provenance

The following attestation bundles were made for codecpod-0.1.0-cp37-abi3-win_amd64.whl:

Publisher: wheels.yml on zhoukezi/codecpod

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codecpod-0.1.0-cp37-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for codecpod-0.1.0-cp37-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ffa62e0e034e71f6f8976be96eb386628033c0c2e28b10d413d2230cf2b2c252
MD5 96d2e6975a0262b68d66991d418f71d4
BLAKE2b-256 f39a3c35607f5de4e5b095988f956f3defb036b83c21c66dc1c754182cd386b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for codecpod-0.1.0-cp37-abi3-manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on zhoukezi/codecpod

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codecpod-0.1.0-cp37-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for codecpod-0.1.0-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6e19e3a2d103968905bc2a2e226a7a97fc742ac33f9fbdbf868d193d0b78dfdf
MD5 1bd8da997430935678490105eaa7bb88
BLAKE2b-256 0b02e4de78b4ebbcb5c1d3a2e91443e1f51b0f0f24f54df44be03e5e2337afa6

See more details on using hashes here.

Provenance

The following attestation bundles were made for codecpod-0.1.0-cp37-abi3-macosx_11_0_arm64.whl:

Publisher: wheels.yml on zhoukezi/codecpod

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codecpod-0.1.0-cp37-abi3-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for codecpod-0.1.0-cp37-abi3-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 07ed11a47df3c9d062e7b653c524584cf596dda7631c1408a9978078e1ed581e
MD5 f3e6c71107a90c8e40fdb81467ea6fb8
BLAKE2b-256 4a20da2672b361f0a2ea50cc27020585b67724c3f33167792af26b25b16692a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for codecpod-0.1.0-cp37-abi3-macosx_10_13_x86_64.whl:

Publisher: wheels.yml on zhoukezi/codecpod

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page