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-1.0.1.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-1.0.1-cp35-abi3-win_amd64.whl (126.4 kB view details)

Uploaded CPython 3.5+Windows x86-64

plibflac-1.0.1-cp35-abi3-win32.whl (120.6 kB view details)

Uploaded CPython 3.5+Windows x86

plibflac-1.0.1-cp35-abi3-musllinux_1_2_x86_64.whl (701.9 kB view details)

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

plibflac-1.0.1-cp35-abi3-musllinux_1_2_i686.whl (718.9 kB view details)

Uploaded CPython 3.5+musllinux: musl 1.2+ i686

plibflac-1.0.1-cp35-abi3-musllinux_1_2_armv7l.whl (503.9 kB view details)

Uploaded CPython 3.5+musllinux: musl 1.2+ ARMv7l

plibflac-1.0.1-cp35-abi3-musllinux_1_2_aarch64.whl (606.3 kB view details)

Uploaded CPython 3.5+musllinux: musl 1.2+ ARM64

plibflac-1.0.1-cp35-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (714.8 kB view details)

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

plibflac-1.0.1-cp35-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl (525.7 kB view details)

Uploaded CPython 3.5+manylinux: glibc 2.17+ ARMv7lmanylinux: glibc 2.31+ ARMv7l

plibflac-1.0.1-cp35-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (620.2 kB view details)

Uploaded CPython 3.5+manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

plibflac-1.0.1-cp35-abi3-manylinux2010_i686.manylinux_2_12_i686.manylinux_2_28_i686.whl (720.7 kB view details)

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

plibflac-1.0.1-cp35-abi3-macosx_11_0_arm64.whl (157.7 kB view details)

Uploaded CPython 3.5+macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for plibflac-1.0.1.tar.gz
Algorithm Hash digest
SHA256 f9cf08501eb86587af6b5942f80afedfd3648d705321da247f38806f06d1091b
MD5 92ae7ac5f65726511288dcdc989c9437
BLAKE2b-256 5c35bdb8f2a44a5cfd13bf97447de2e68f8fa0f76b12ae74f1e435693cb47119

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for plibflac-1.0.1-cp35-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c25b3bad3165a1d7410698f94d6633b789a894a06f83a925901d774adf3103ac
MD5 4121b73b94c94a94cc6f503256999908
BLAKE2b-256 a66f70b6a754054793dce3cae2f467485ae4e68b90c49f02917f8666016bf692

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for plibflac-1.0.1-cp35-abi3-win32.whl
Algorithm Hash digest
SHA256 511bdfc260ce0f086e32198c4ea07a58a77e430acf05a9fdba3afc758353c8ae
MD5 97c68de655e51d2ad5eb4f2355774434
BLAKE2b-256 a57af98bc395893209bc3244c1a01e81190f242b29038310634ebaac037a91c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-1.0.1-cp35-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e8bca65f9d6fc3768280d580883c163850490231dd14c36e31486132921675fe
MD5 9b14094e2a090e6a1bf4338f2a9d174e
BLAKE2b-256 b58215cd1b223e954b940ea40e4f24cb00522733afa50c9ff6936f9801529747

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-1.0.1-cp35-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 c2e0eb2b7b310ed0215addf1aaeb000cd2af75594ecc1080cea438a65c9302e9
MD5 1b2c33269eefd60f03bd6e4eb2c11d2b
BLAKE2b-256 147253ff674603c42fbb20114effb1f62bb325fde20f4082af0d2e1ef6c3b600

See more details on using hashes here.

File details

Details for the file plibflac-1.0.1-cp35-abi3-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for plibflac-1.0.1-cp35-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 725fdb13dc27739f19202ff7147ec1b24b61344ab32682eee28cf5982b74e91b
MD5 1f677db4b4c54220abcf0d79e7fc8a06
BLAKE2b-256 fdf32bb0867bab2ad68e748cc1d663b1c42752790f3faf5b227a1deee72a2c5f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-1.0.1-cp35-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 4ce55b606d5cffced8c2850656afe97e2a00e43b90bd6ea9f5635f8f356f1491
MD5 4aa844be0a3a1121858eec1cd91b4b19
BLAKE2b-256 011e289110ac1afbb63b20155071b9262125952bdbb532f4893a2c0df56a94c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-1.0.1-cp35-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6c0973cdf584c0fdcb34c280ecf2ca17983e1a434760d1800a591ff721d20ef4
MD5 60cdb2d5446e9f19b3e84e0858bef9ca
BLAKE2b-256 0c948f61218bf7b1c53e5d302aa29a1c217a8eb48b0dfdd0e96f9aca807a9843

See more details on using hashes here.

File details

Details for the file plibflac-1.0.1-cp35-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl.

File metadata

File hashes

Hashes for plibflac-1.0.1-cp35-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl
Algorithm Hash digest
SHA256 bbdf5527fc4a2f26463bc337adc199aa43a61dbb026d3ad13181d2365cf8e2a3
MD5 4675a6896adf5e5e21fe56e6a1967331
BLAKE2b-256 7b87da7bab61005b4c2e724aecf86c74416744388bbc1d0da9871622208f4606

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-1.0.1-cp35-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 3c120bda6648fd88ded3f4870eb170892ed656a46ab312f696afc801b5028266
MD5 808fabb35bfe1a6e72db56272a40dc03
BLAKE2b-256 37a69ce9435bfee06236af2a0179c5fb5e4990f0d42909d068d6274014605840

See more details on using hashes here.

File details

Details for the file plibflac-1.0.1-cp35-abi3-manylinux2010_i686.manylinux_2_12_i686.manylinux_2_28_i686.whl.

File metadata

File hashes

Hashes for plibflac-1.0.1-cp35-abi3-manylinux2010_i686.manylinux_2_12_i686.manylinux_2_28_i686.whl
Algorithm Hash digest
SHA256 c59135fbda4674fdafafaaf7df3c9e61ca620584c2ba5a58b30de8f069b9852b
MD5 33956e4f64690f73494a502a3c4871ec
BLAKE2b-256 5f0e463822308e59ebcd5292b8c66c5b89773c2834b31b4b6b550550624599be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-1.0.1-cp35-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e99df1cf907ad35781f839aa2bfde2dbbfbe836187af5ba055783fda380d17f1
MD5 658046f4173d4ffc2f1e51d517bb8b0e
BLAKE2b-256 d4c28e8acaae140dd6a5630350d7f28a1a03af1feadf5574c4e4355e80eca0f1

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