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

Uploaded CPython 3.5+Windows x86-64

plibflac-1.0.0-cp35-abi3-win32.whl (117.2 kB view details)

Uploaded CPython 3.5+Windows x86

plibflac-1.0.0-cp35-abi3-musllinux_1_2_x86_64.whl (701.8 kB view details)

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

plibflac-1.0.0-cp35-abi3-musllinux_1_2_i686.whl (718.6 kB view details)

Uploaded CPython 3.5+musllinux: musl 1.2+ i686

plibflac-1.0.0-cp35-abi3-musllinux_1_2_aarch64.whl (606.1 kB view details)

Uploaded CPython 3.5+musllinux: musl 1.2+ ARM64

plibflac-1.0.0-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (683.2 kB view details)

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

plibflac-1.0.0-cp35-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (629.3 kB view details)

Uploaded CPython 3.5+manylinux: glibc 2.17+ ARM64

plibflac-1.0.0-cp35-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl (703.5 kB view details)

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

plibflac-1.0.0-cp35-abi3-macosx_11_0_arm64.whl (159.8 kB view details)

Uploaded CPython 3.5+macOS 11.0+ ARM64

plibflac-1.0.0-cp35-abi3-macosx_10_13_x86_64.whl (190.1 kB view details)

Uploaded CPython 3.5+macOS 10.13+ x86-64

File details

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

File metadata

  • Download URL: plibflac-1.0.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-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c23f559a33bd6c301904dae3c2f51e377a65c5885a381eb5b0429c68ae02b1a7
MD5 73d412c36313aa88863683c15f210efb
BLAKE2b-256 7ddfa22ca4ff1ec0f26a9005b3bef9dca16ec330834aef690ccc0b6dbe9ddc2a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plibflac-1.0.0-cp35-abi3-win_amd64.whl
  • Upload date:
  • Size: 122.6 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-1.0.0-cp35-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c9ff80d45dc22039500fedbf2d94284c6170dfc683da9e9f6cbd96153778b20d
MD5 183086764ec91415bc59bea882597e78
BLAKE2b-256 1a70ab75e1c31e23a2c6e537f8ea52a16f8497c7e02793d133dbfac9dcb27e29

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plibflac-1.0.0-cp35-abi3-win32.whl
  • Upload date:
  • Size: 117.2 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-1.0.0-cp35-abi3-win32.whl
Algorithm Hash digest
SHA256 7598c32dd002383e18832f1295cc8210a3bb630d0789b813a8c6eb901e9fecdf
MD5 e7daa602b86118c77d76734fbcc575b4
BLAKE2b-256 e19d52649b976f0ad9850a4c99b432676dbf86b3dc64109a8b1231c5fba01953

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-1.0.0-cp35-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3068d8a5255e7a92c394d0d8e71be11deb95f7fdc79e161083aa1acda8e6be9a
MD5 a88950708ed4d964ebcc13b1b44392e6
BLAKE2b-256 84896cb0c7e8b73664c9971fa139cb390076a30fd884e0eb6fd05b63ba1a60ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-1.0.0-cp35-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 c3f3de66f1598eef9ea609290a29ad1b317b7212f439f11284b28fe1777154bb
MD5 d9f6c64c405712f26f31be838ef50e56
BLAKE2b-256 6bdad033721ad04d2f1a2e876532773032d88ee5a5c6c471164fd386196c36cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-1.0.0-cp35-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 d914b98aba5ff3bbd146df7c60f9fb2e68d962d1eed10df547086f52fa2b0393
MD5 34ff7e38d41ed6344e5db2e2465dca2c
BLAKE2b-256 2da5a97943ea0f9505309400d27f88e6676d2051e5a5617e60a966a96c161e51

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-1.0.0-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 53c389758173a58f34373101a88a2356d1b9741e75c4b3c432a47133acfdadd4
MD5 d172da1ea659c2563a5a056ede897e97
BLAKE2b-256 e1bbb976501466ff16ec633baf6b3e3f69eb2ee9ebf0bb5a5380b3fa39d93b79

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-1.0.0-cp35-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 55e8b3922b145c89fe458be6bbdc0be9b8f5b1632a33f5aed34294971d3b5d8e
MD5 6f8f2486022b81a7798d81974b609847
BLAKE2b-256 129b7d1f96c4303ed553d0acae72925757aa0cc94c812fc1abd465d02bfc45af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-1.0.0-cp35-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 40e571f184084100062937bd2e9c8db2a1555b3fc2001a50eabc5858fcbac46e
MD5 402bf5a73db3d20aa4ecca295d07319f
BLAKE2b-256 7bb6f0531483cb47e706893ff4487b18da93dd14bf974d87b8da7370770b8114

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-1.0.0-cp35-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7bd31f1babfcfa095b48ea785ec4c2cb3c8d2ee0b1344c82cc5b0860d31f3621
MD5 95018841d481c3861f46b1b901bd1bcd
BLAKE2b-256 ae7e0b225fdbf790bcd0e9e53206cd2c12b6ed455f1f80369c8534b578588113

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-1.0.0-cp35-abi3-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 a3af07f5cb64c4d74ea06aafa133a089db374e8add7dec45cf666b73ee24f051
MD5 1f5056ac6c3e0803d9b00b459089a676
BLAKE2b-256 38cfa9bd97b318748cbd93c0be61f9997c1cc81489f9907033347147378fdcf4

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