Skip to main content

Read and write FLAC audio files

Project description

plibflac

This package provides a Python library for reading and writing audio files in FLAC (Free Lossless Audio Codec) format.

plibflac is implemented as a wrapper around the reference FLAC implementation (libFLAC) written by Josh Coalson and maintained by Xiph.Org.

Installation

Install this package from PyPI by running:

pip install plibflac

If you want to build the package from source (e.g., from the git repository), you will need to have a C compiler and the Python headers installed.

Project goals

The main goal of this project is to provide a portable and efficient interface for reading and writing raw sample data, in FLAC format, from Python applications.

This package currently does not implement the complete functionality provided by the FLAC library. If there are particular missing features that your application needs, please report them via GitHub issues.

Example

In the code below, we first open a FLAC file and print the first 10 samples of each channel. Next, we read the entire stream and write it out to a new FLAC file (re-encoding it using compression level 8.)

import plibflac

with plibflac.Decoder("input.flac") as decoder:
    samples = decoder.read(10)
    for i, s in enumerate(samples):
        print("First 10 samples of channel {}: {}".format(i, list(s)))

    decoder.seek(0)
    with plibflac.Encoder("output.flac", compression_level=8,
                          channels=decoder.channels,
                          bits_per_sample=decoder.bits_per_sample,
                          sample_rate=decoder.sample_rate) as encoder:
        while data := decoder.read(1000):
            encoder.write(data)

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

plibflac-0.2.0.tar.gz (1.7 MB view details)

Uploaded Source

Built Distributions

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

plibflac-0.2.0-cp35-abi3-win_amd64.whl (121.9 kB view details)

Uploaded CPython 3.5+Windows x86-64

plibflac-0.2.0-cp35-abi3-win32.whl (116.4 kB view details)

Uploaded CPython 3.5+Windows x86

plibflac-0.2.0-cp35-abi3-musllinux_1_2_x86_64.whl (691.5 kB view details)

Uploaded CPython 3.5+musllinux: musl 1.2+ x86-64

plibflac-0.2.0-cp35-abi3-musllinux_1_2_i686.whl (709.3 kB view details)

Uploaded CPython 3.5+musllinux: musl 1.2+ i686

plibflac-0.2.0-cp35-abi3-musllinux_1_2_aarch64.whl (596.6 kB view details)

Uploaded CPython 3.5+musllinux: musl 1.2+ ARM64

plibflac-0.2.0-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (672.7 kB view details)

Uploaded CPython 3.5+manylinux: glibc 2.17+ x86-64

plibflac-0.2.0-cp35-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (621.0 kB view details)

Uploaded CPython 3.5+manylinux: glibc 2.17+ ARM64

plibflac-0.2.0-cp35-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl (693.4 kB view details)

Uploaded CPython 3.5+manylinux: glibc 2.12+ i686manylinux: glibc 2.17+ i686

plibflac-0.2.0-cp35-abi3-macosx_11_0_arm64.whl (156.5 kB view details)

Uploaded CPython 3.5+macOS 11.0+ ARM64

plibflac-0.2.0-cp35-abi3-macosx_10_13_x86_64.whl (186.1 kB view details)

Uploaded CPython 3.5+macOS 10.13+ x86-64

File details

Details for the file plibflac-0.2.0.tar.gz.

File metadata

  • Download URL: plibflac-0.2.0.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for plibflac-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6954175783d98870b5fa12a81fb49ad5cc8589eb39a228f2554bc88349ebaa3a
MD5 368972ddf330d283e8d173725444ddba
BLAKE2b-256 dd830b9e464ca08f6d98625d9371dbeaba535607b6d61f16919ce83fb760c4bf

See more details on using hashes here.

File details

Details for the file plibflac-0.2.0-cp35-abi3-win_amd64.whl.

File metadata

  • Download URL: plibflac-0.2.0-cp35-abi3-win_amd64.whl
  • Upload date:
  • Size: 121.9 kB
  • Tags: CPython 3.5+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for plibflac-0.2.0-cp35-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6bd5901a3ba493fc0cbcec4c7fb8085d99ea586b95420b404766bad268b72980
MD5 40902762928b23d094fa3c53654cab31
BLAKE2b-256 846383113640dda8c29612a4356e2607040bb7c2b9d92d3953f1253d48bb3552

See more details on using hashes here.

File details

Details for the file plibflac-0.2.0-cp35-abi3-win32.whl.

File metadata

  • Download URL: plibflac-0.2.0-cp35-abi3-win32.whl
  • Upload date:
  • Size: 116.4 kB
  • Tags: CPython 3.5+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for plibflac-0.2.0-cp35-abi3-win32.whl
Algorithm Hash digest
SHA256 a9ad09c11a8c5c9e6ef0f320483155a20da242042f2a34a7d4fcbcb79b6e856c
MD5 c91b51d374afec46dd29fb069a901504
BLAKE2b-256 107f7ec7dfd034085b6cd820be3a494708ff0e9d0682cdb4bcecccd4bb9c47ef

See more details on using hashes here.

File details

Details for the file plibflac-0.2.0-cp35-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for plibflac-0.2.0-cp35-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 99bc3ced2cd7780c28a3c1e9654b689c536be9095a2251314adce3ab3656db6f
MD5 52f8874d9ddd65632f84034ae0f37ca4
BLAKE2b-256 23589a8ee0b5c1670c775e7bd4607b24b8b3e99eda024874cb64591cc7d95f88

See more details on using hashes here.

File details

Details for the file plibflac-0.2.0-cp35-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for plibflac-0.2.0-cp35-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 f97d5033e777bb0da87ad889202812a76daa3d0c8b69939ed4784cfe7bb3622e
MD5 a8a7c31d60bd3cab3004b4239a72c97a
BLAKE2b-256 bec7a2e01b6f6257e184578d32e1fdcd8f2be6c9c36f7de6a2be87b12e530348

See more details on using hashes here.

File details

Details for the file plibflac-0.2.0-cp35-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for plibflac-0.2.0-cp35-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 2e6e729d8a0780815a6fce01b607e3ee810a321f4cb202d43ab6c73fb68c35d5
MD5 05e60a8b54212b2c5c27f802f16a8e86
BLAKE2b-256 cb4d81a6940c4e33141fe71954d77e85ed3606756c1a2af78408be3e31062359

See more details on using hashes here.

File details

Details for the file plibflac-0.2.0-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for plibflac-0.2.0-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1bfaee826b4db91c1528da2665e959ef6ba83b428f65a527673e0e690d407381
MD5 de19058acc83aa8714aa4433ff7c5afd
BLAKE2b-256 c57914ebb07bf47503c689dc1c36cb29f99ad5260fbd0418f68bf654ff0c57dc

See more details on using hashes here.

File details

Details for the file plibflac-0.2.0-cp35-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for plibflac-0.2.0-cp35-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a4b761316d7272717c2dcb850499452ed3cc77001f9c24b9e0966ecef142d0bc
MD5 30db6fba19f302ac0401fdcfe391a51c
BLAKE2b-256 8758a0ce92a9877500d19ff248810ccfc817ee22367fa18b79b6ca23cb87c183

See more details on using hashes here.

File details

Details for the file plibflac-0.2.0-cp35-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for plibflac-0.2.0-cp35-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 855f1978feaef657565e1a1faaa10284941135667f18ff5ffcfe310fd75752b8
MD5 fdce0300f08f39afc79e578aaa6faee1
BLAKE2b-256 3d140fd00c83d9386dc7c5fbbba6c23fe55c331bfc6a16cd39480259e6439f31

See more details on using hashes here.

File details

Details for the file plibflac-0.2.0-cp35-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for plibflac-0.2.0-cp35-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 569836a366a375f81f5e39cc7e3ad874349b1156bbb967e020459901d44e18c3
MD5 c77fb50e728595f55e1c32d67c0ead93
BLAKE2b-256 f79698f2ef92b5fe735bb5d77f88f11e2c17d1744e0b0de2fd18348b1e98392a

See more details on using hashes here.

File details

Details for the file plibflac-0.2.0-cp35-abi3-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for plibflac-0.2.0-cp35-abi3-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 bf0fc01b3dc1b3c0988f77085d91fb41e3a7a5c073b43589d5f26868b6ac6034
MD5 f96c2e6911f646b1218fc284dc636608
BLAKE2b-256 21c2cf2b0856d3aa5629a9d0f9b421b9b03ab8005fe515940fa33fe159fb26b9

See more details on using hashes here.

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