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.1rc3.tar.gz (82.0 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.1rc3-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.1rc3-cp314-cp314t-macosx_11_0_arm64.whl (3.5 MB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

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

Uploaded CPython 3.14tmacOS 10.13+ x86-64

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

Uploaded CPython 3.7+Windows x86-64

codecpod-0.1.1rc3-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.1rc3-cp37-abi3-macosx_11_0_arm64.whl (3.5 MB view details)

Uploaded CPython 3.7+macOS 11.0+ ARM64

codecpod-0.1.1rc3-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.1rc3.tar.gz.

File metadata

  • Download URL: codecpod-0.1.1rc3.tar.gz
  • Upload date:
  • Size: 82.0 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.1rc3.tar.gz
Algorithm Hash digest
SHA256 9ab2c0eedc51f2653c1d78d23ea2de7b6f17c996c2bc6ed545fa03e340bba011
MD5 f8482ee5e1ad0d6bf9eb51e33e2056b1
BLAKE2b-256 f59dc61978c47d8d3533e6da83b2a03bf9a62c53845847d81a8b33e0d42b07cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for codecpod-0.1.1rc3.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.1rc3-cp314-cp314t-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for codecpod-0.1.1rc3-cp314-cp314t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c16390324eb03d6b25e97b90e72468a30ab63e71046d087f7e6e38e4dab37090
MD5 a98e025177e694fca27d84ecc39498bc
BLAKE2b-256 b8ae7dc2196c3bd823a5944bc8e8bd9cb7948c25698d57905ebee787e7df36b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for codecpod-0.1.1rc3-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.1rc3-cp314-cp314t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for codecpod-0.1.1rc3-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f1116aede98eda7a38f28af0ee9550340f41358cac075a1e31602b539b6dd0f1
MD5 736f525e9a0f0b5f2711a05e2eb9eff3
BLAKE2b-256 a5b0e382131d39c3d164eef1b15046ca8d2f5a6c3e221a55f653ffea98ddbf8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for codecpod-0.1.1rc3-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.1rc3-cp314-cp314t-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for codecpod-0.1.1rc3-cp314-cp314t-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 b801e0fc88a9d1c72384040b1784f9d3f1e2004659c7b530ee8e7d82b8b597c2
MD5 1784e4a1f9911e2bcdb9e90e1984b72e
BLAKE2b-256 867e7e99c37ef88f582a3295b70e34fa163f1d76dbc0cb5b356dff0f6060b343

See more details on using hashes here.

Provenance

The following attestation bundles were made for codecpod-0.1.1rc3-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.1rc3-cp37-abi3-win_amd64.whl.

File metadata

  • Download URL: codecpod-0.1.1rc3-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.1rc3-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 9ad8f4b6dea52a8cd17567e8fc7d24c9c9a8fbe242c300eceec4f085aa0837d3
MD5 1a2bf452f3907285e1f3e4a181aaaae6
BLAKE2b-256 b56843986ea126668a61287b612e76c80f95316d3bb95090581826d36760dfae

See more details on using hashes here.

Provenance

The following attestation bundles were made for codecpod-0.1.1rc3-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.1rc3-cp37-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for codecpod-0.1.1rc3-cp37-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2cba35de165ed49ae0f644b5acc29c5ac94ba5b1047f2619f789b9013d2e0cb0
MD5 ac52b9d82babb336b4b91899bb86a806
BLAKE2b-256 ed8225ac774b7754b19c35d96779efc6c759c2be96133bc1ad6c31a467184c69

See more details on using hashes here.

Provenance

The following attestation bundles were made for codecpod-0.1.1rc3-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.1rc3-cp37-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for codecpod-0.1.1rc3-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 85a36439569422f5c4e6b711522b370b08e97535907ba66029d192223d6b26c3
MD5 60c1a2108ada9a2b0a23d425727e0717
BLAKE2b-256 187cda7c11e3891fb609eed42369bd83be61035713fd3b38b008117cbf590e76

See more details on using hashes here.

Provenance

The following attestation bundles were made for codecpod-0.1.1rc3-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.1rc3-cp37-abi3-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for codecpod-0.1.1rc3-cp37-abi3-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 7b57e47e79c1b070adc9e156ed30d1632c4f139782213d7f6d676dbe62a50ea8
MD5 2a552919664b4947d03582c6d0b247db
BLAKE2b-256 dbe7acb75264561ff34909a95cbdbfc80ae64180670bb87163bed72a69e5bf95

See more details on using hashes here.

Provenance

The following attestation bundles were made for codecpod-0.1.1rc3-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