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

Uploaded CPython 3.14tmacOS 11.0+ ARM64

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

Uploaded CPython 3.14tmacOS 10.13+ x86-64

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

Uploaded CPython 3.7+Windows x86-64

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

Uploaded CPython 3.7+macOS 11.0+ ARM64

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

File metadata

  • Download URL: codecpod-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 dfd615b8b9c8fe3d42ae177dda7b9f10626dbce39181b7dec7d9024a43c7e76a
MD5 3ccc2d2a54133e3261ea0fda1733f414
BLAKE2b-256 e9fa0d07bbdf562ac7c5b6f7252dc03a415935c7dcf56d429c029a3b2623c1ef

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for codecpod-0.1.1-cp314-cp314t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ff3ef0f38b3864ff2f9d3586aaf6cd00defa90d4ccb576bcfe68a90d07faaa2d
MD5 688ab75f38d62f521898c257747e763a
BLAKE2b-256 0680572a87fe7e98df4a85807e1b5f1e80641d19c0d2c45885e3c4768a4e98f9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for codecpod-0.1.1-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ed0e488d0f40ec2bcd2dbb3374a136851d860d5d337871dfea08f69dc907b6bc
MD5 147b46e919bfd48e8de6f992ee783050
BLAKE2b-256 181a0b9a40c8f1f83af0ae77cea2a25feadb8b5dd05b56731e453c257002803b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for codecpod-0.1.1-cp314-cp314t-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 9c53f1e6eb7497d99f03e8e720fac2c9a3acdb975e51779fdebb56d10aa092a6
MD5 e32bff3b4426bb66088c6d7e812170eb
BLAKE2b-256 7ed7fd2008b2c8350637729826bccfdc7ce4e2278bf1d9523b6821991f3d1c16

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: codecpod-0.1.1-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.1-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 fb5bc15956df05dca532ba7c82468f156f58538eb88ab8586f3b2bbe79c49138
MD5 0da3a49b03f3de90d8e842a11c569d4c
BLAKE2b-256 2d369446ab3e1d8cad2a225608bad84f34f508011368739d392410f93972dfc8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for codecpod-0.1.1-cp37-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0057dfb2f9b573b52b030168f5ccb64ea675c3ba7434ecf9120d5cb7dc033fea
MD5 aab6c2e2b5c925b2500a93916e28321e
BLAKE2b-256 8e71d4b62d529de65f1f6630581f38da798f69cfbd0726720872a5b80765130e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for codecpod-0.1.1-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ca7f15e7cc9720e0a3865596da7ac465246a6e8813fc02053c342ecde1dfdfa8
MD5 cb14b6d3298f346cef3984463e92218d
BLAKE2b-256 8d27e552112a6c6614859105d4a313c376d4aa6c62a96e2cb870543a43814b3a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for codecpod-0.1.1-cp37-abi3-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 008c6c2c0508814bf572667b11586b89959cdbfea8bdbc3f120a2b7fb359f81a
MD5 b882d9255e789cb544c3602c16b820c3
BLAKE2b-256 f0c6890ebdaa1947494bf7d1a25282bea9ebcc2b0729a86e9223584f890e66d2

See more details on using hashes here.

Provenance

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