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.0.2.tar.gz (1.6 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.0.2-pp39-pypy39_pp73-win_amd64.whl (101.3 kB view details)

Uploaded PyPyWindows x86-64

plibflac-0.0.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (133.0 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

plibflac-0.0.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (130.8 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

plibflac-0.0.2-pp39-pypy39_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl (149.6 kB view details)

Uploaded PyPymanylinux: glibc 2.12+ i686manylinux: glibc 2.17+ i686

plibflac-0.0.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl (129.4 kB view details)

Uploaded PyPymacOS 11.0+ ARM64

plibflac-0.0.2-pp39-pypy39_pp73-macosx_10_15_x86_64.whl (145.1 kB view details)

Uploaded PyPymacOS 10.15+ x86-64

plibflac-0.0.2-cp35-abi3-win_amd64.whl (101.1 kB view details)

Uploaded CPython 3.5+Windows x86-64

plibflac-0.0.2-cp35-abi3-win32.whl (90.7 kB view details)

Uploaded CPython 3.5+Windows x86

plibflac-0.0.2-cp35-abi3-musllinux_1_2_x86_64.whl (518.4 kB view details)

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

plibflac-0.0.2-cp35-abi3-musllinux_1_2_i686.whl (517.7 kB view details)

Uploaded CPython 3.5+musllinux: musl 1.2+ i686

plibflac-0.0.2-cp35-abi3-musllinux_1_2_aarch64.whl (492.0 kB view details)

Uploaded CPython 3.5+musllinux: musl 1.2+ ARM64

plibflac-0.0.2-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (516.9 kB view details)

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

plibflac-0.0.2-cp35-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (501.4 kB view details)

Uploaded CPython 3.5+manylinux: glibc 2.17+ ARM64

plibflac-0.0.2-cp35-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl (513.0 kB view details)

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

plibflac-0.0.2-cp35-abi3-macosx_11_0_arm64.whl (141.2 kB view details)

Uploaded CPython 3.5+macOS 11.0+ ARM64

plibflac-0.0.2-cp35-abi3-macosx_10_9_x86_64.whl (159.1 kB view details)

Uploaded CPython 3.5+macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: plibflac-0.0.2.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for plibflac-0.0.2.tar.gz
Algorithm Hash digest
SHA256 755a6fb83c93db97bb5b42f5efac3026545ebd7f9bcf708afaa80133ae5d022d
MD5 1b4bd30d26d1a6e6af10a8b37a70fb30
BLAKE2b-256 eb74e03449b268b1b695ff4c95665ea733367c2768d4718566e1e4b41a2f96d6

See more details on using hashes here.

File details

Details for the file plibflac-0.0.2-pp39-pypy39_pp73-win_amd64.whl.

File metadata

  • Download URL: plibflac-0.0.2-pp39-pypy39_pp73-win_amd64.whl
  • Upload date:
  • Size: 101.3 kB
  • Tags: PyPy, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for plibflac-0.0.2-pp39-pypy39_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 88abbc4ab1ff8ae01cf0fd50abcbd53686fbb0d7b65a7522433cbd3a462130f8
MD5 1f7b7da1e50e0ddac00df40a705266bf
BLAKE2b-256 a177f97a1bb37694f53d3eb01f582bfb39f749fa254855dba604c456c2608e39

See more details on using hashes here.

File details

Details for the file plibflac-0.0.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for plibflac-0.0.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 965e4a2044dc4568524fef1d0d9bb698346420fade098351ecafc70571035743
MD5 ee9721ca35b2125919d1a81898509e54
BLAKE2b-256 b6812e768f7354ff9a8f01b6d8c5c287328819cb8a04137b4b15ea17d5a00246

See more details on using hashes here.

File details

Details for the file plibflac-0.0.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for plibflac-0.0.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 fe678ec8b7145fdf9f042d4851f558c0a5d2d9de8e8aef3f91e065c07b76f808
MD5 8a494384b2d58c93fcbe74fe446626f9
BLAKE2b-256 9e1a022ea1e151958e7ccac63da5454155e015d988485b1f1bd279f87b27e6ba

See more details on using hashes here.

File details

Details for the file plibflac-0.0.2-pp39-pypy39_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for plibflac-0.0.2-pp39-pypy39_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 e1ead4609e677df03cd68b7af348d56cb548a5649ae543982028d9c681567c42
MD5 e2e436b9fb2e06347d22082bbbab6c85
BLAKE2b-256 450d4595540cfc34d56764f6faf677399f04d720046e52cfd9a605b5d8694f6b

See more details on using hashes here.

File details

Details for the file plibflac-0.0.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl.

File metadata

  • Download URL: plibflac-0.0.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 129.4 kB
  • Tags: PyPy, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for plibflac-0.0.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a83064bce8b6417f6a471ca7491c77e8e720fbe9772ad0f91e053a76e7420a5a
MD5 934d2a8bb279d9ee4efe9f93924bbfdf
BLAKE2b-256 8107ea6e4322000689177859e1e5b6f20f7c2dc5f694d84d2ea92cddee97a70d

See more details on using hashes here.

File details

Details for the file plibflac-0.0.2-pp39-pypy39_pp73-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: plibflac-0.0.2-pp39-pypy39_pp73-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 145.1 kB
  • Tags: PyPy, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for plibflac-0.0.2-pp39-pypy39_pp73-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 0fd75b6931499050c01d6483a13202eb927e242039aef6b185cb654baa7946a2
MD5 d550bde438bbf2f1f2af9621e6f71f52
BLAKE2b-256 62853a684c22eb9234ad7851dfd47f008e05e02b58d8090746db53a96665a460

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plibflac-0.0.2-cp35-abi3-win_amd64.whl
  • Upload date:
  • Size: 101.1 kB
  • Tags: CPython 3.5+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for plibflac-0.0.2-cp35-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0210540db35b5033bb60ab40b60557a4d040274dee9462574fd0c6cc2eee021c
MD5 c3a0eb4a3e86612cbd3ae89488573f37
BLAKE2b-256 efadef08d3ced6c63010d5fc55dcaefb6f34bca4dc0d95eb61820842c8372f54

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plibflac-0.0.2-cp35-abi3-win32.whl
  • Upload date:
  • Size: 90.7 kB
  • Tags: CPython 3.5+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for plibflac-0.0.2-cp35-abi3-win32.whl
Algorithm Hash digest
SHA256 8bb1fd170d923af5289eaa33f791e73de13a2a14479f2179b64f6cbac769f3de
MD5 8d7b48511d24bf57cc0960b48cdcee96
BLAKE2b-256 f847613ca7a17d2ec0b9a98e225c951fd3c90be6331d0f0dd505e3aefe5850c0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plibflac-0.0.2-cp35-abi3-musllinux_1_2_x86_64.whl
  • Upload date:
  • Size: 518.4 kB
  • Tags: CPython 3.5+, musllinux: musl 1.2+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for plibflac-0.0.2-cp35-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 94cc42d147e3bbe77bfef96ecf167a7fef702ad8839502be92ae09ffd7f6cca1
MD5 e18d5ec74c6e294592c68187d75be898
BLAKE2b-256 476b90ba4529576dab7b5d34778f4982ad49c97b4f56ac2edfe71a0295509b79

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plibflac-0.0.2-cp35-abi3-musllinux_1_2_i686.whl
  • Upload date:
  • Size: 517.7 kB
  • Tags: CPython 3.5+, musllinux: musl 1.2+ i686
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for plibflac-0.0.2-cp35-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 47af1d09a04d500d6df4ce148e7244f5c6560372a5d023802d50568ca69f5f01
MD5 4ecb3fcd428e69d6036f068052092b29
BLAKE2b-256 a95a3e3e05c296bf91a0519e0f2c280f7f58783e8ed6d6239cc631a7a1773f09

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plibflac-0.0.2-cp35-abi3-musllinux_1_2_aarch64.whl
  • Upload date:
  • Size: 492.0 kB
  • Tags: CPython 3.5+, musllinux: musl 1.2+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for plibflac-0.0.2-cp35-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 19349cc629910a003b8ad09f9f15db03bd7d352c5bb21e5278bde2f167202df5
MD5 d429363b289eb940f501d88aa9806545
BLAKE2b-256 5d3496ed8b1ee8b8d8f0e5bec862652bb63b97d53508a552b20aa6f074587467

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-0.0.2-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3928a9af12f973573854aa54d6d76328214b7b59c985cdd413b8a51f70a90d89
MD5 dd9f654b91de0230a6f99dd685ce74d0
BLAKE2b-256 ab5a7f9ee4dab443f9238775fda664f261389ef1de0705a6da3eef533aeca3b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-0.0.2-cp35-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c7a9fb9aead364db0ef30c88d2c1f1fbc8b72d5db84b2d303f07804a7aee0e78
MD5 a138067a16d42b3934226cd2545f519b
BLAKE2b-256 265d0acea85f0d2f8a5f7b1ff2ca6c129b62fbf3b145ef1e22f685357a3a6245

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-0.0.2-cp35-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 ee1f09224a358e1c8c56c64b0936a381fd0971a35ecfbe4a98338b7ca2979d0e
MD5 c8e9ef062003f7249c19246ac11f79ef
BLAKE2b-256 615a7df8328ac898ab614453d6b179d0a70dd6760fa4776a5b4418a06a40c268

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plibflac-0.0.2-cp35-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 141.2 kB
  • Tags: CPython 3.5+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for plibflac-0.0.2-cp35-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a6298e9c205686fc2242f8af9bd5e12c6453ea5f451399f9cdf02519207ea6cb
MD5 9ed3f7b90e073562b88e79105813dc80
BLAKE2b-256 8108cfe0951065ab6f2f97b6f947f6f21c4119c5ff526ce1c51463c4993162fa

See more details on using hashes here.

File details

Details for the file plibflac-0.0.2-cp35-abi3-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: plibflac-0.0.2-cp35-abi3-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 159.1 kB
  • Tags: CPython 3.5+, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for plibflac-0.0.2-cp35-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1259f8e94d9bf2e887ad8e3e159b0066418ca8bfe56f21edb3f41ff48318fe0d
MD5 94fdaaf9df856479dbb88915af6543b0
BLAKE2b-256 b01ffcc97f93c37c5b6c6f01387143844885af5c37ceb742193b89cccf1c868e

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