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.1.0.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.1.0-pp39-pypy39_pp73-win_amd64.whl (106.4 kB view details)

Uploaded PyPyWindows x86-64

plibflac-0.1.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (138.0 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

plibflac-0.1.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (135.8 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

plibflac-0.1.0-pp39-pypy39_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl (154.6 kB view details)

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

plibflac-0.1.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl (134.4 kB view details)

Uploaded PyPymacOS 11.0+ ARM64

plibflac-0.1.0-pp39-pypy39_pp73-macosx_10_15_x86_64.whl (150.2 kB view details)

Uploaded PyPymacOS 10.15+ x86-64

plibflac-0.1.0-cp35-abi3-win_amd64.whl (106.1 kB view details)

Uploaded CPython 3.5+Windows x86-64

plibflac-0.1.0-cp35-abi3-win32.whl (96.0 kB view details)

Uploaded CPython 3.5+Windows x86

plibflac-0.1.0-cp35-abi3-musllinux_1_2_x86_64.whl (523.4 kB view details)

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

plibflac-0.1.0-cp35-abi3-musllinux_1_2_i686.whl (522.7 kB view details)

Uploaded CPython 3.5+musllinux: musl 1.2+ i686

plibflac-0.1.0-cp35-abi3-musllinux_1_2_aarch64.whl (496.9 kB view details)

Uploaded CPython 3.5+musllinux: musl 1.2+ ARM64

plibflac-0.1.0-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (521.9 kB view details)

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

plibflac-0.1.0-cp35-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (506.4 kB view details)

Uploaded CPython 3.5+manylinux: glibc 2.17+ ARM64

plibflac-0.1.0-cp35-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl (518.0 kB view details)

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

plibflac-0.1.0-cp35-abi3-macosx_11_0_arm64.whl (146.2 kB view details)

Uploaded CPython 3.5+macOS 11.0+ ARM64

plibflac-0.1.0-cp35-abi3-macosx_10_9_x86_64.whl (164.2 kB view details)

Uploaded CPython 3.5+macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: plibflac-0.1.0.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.1.0.tar.gz
Algorithm Hash digest
SHA256 f078450f7c09173f394bfa097806c404b1cd79055a2b8a7d962fa736578c12e4
MD5 0b3f6d29f221e8d60fd9ee78dca09982
BLAKE2b-256 a251db025621d0c9f3644a5f608b9292639da46570218df36f334e3bb71567ab

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plibflac-0.1.0-pp39-pypy39_pp73-win_amd64.whl
  • Upload date:
  • Size: 106.4 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.1.0-pp39-pypy39_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 977125e735f23422b9af865834addc587930165997cdcfe598c40420726cde31
MD5 e0100b6feec728a9ed1f4edb34deedc5
BLAKE2b-256 b96ecdc526c051e4ac1df7e2da6a215e573ac40f00c90e2d9476be0d3cfeef9d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-0.1.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3fdf0d5917d0082d4ef666265770875ae6866d82ed135f1f1a2b3a0c7c49e642
MD5 b56b17e5372fc4a143fbc6e70fbccc13
BLAKE2b-256 0d21926c7d72d14b5603f97bda6b224c32a338df8be2f071d05db7e7cf1adb3c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-0.1.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 43c44d6f8d12d1d0756b78bd72984a3a53d9d75f9109df37680701d815500db1
MD5 1e61e8da7578d2258713084238291022
BLAKE2b-256 ebb0de03e068f719f30459c1504f97bd1af1fea06b64249d3bbcb0d363e6348a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-0.1.0-pp39-pypy39_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 34a31cd9f6a8b118c8e03f82b7aa57322c9e0f40f9bfa3fc056c7bb1c9184f6e
MD5 be72a93a4d1febacd8662b6465eae40c
BLAKE2b-256 321867b851a61e5b28cbcc9b2e757d0667a480ea56309182523c32e3a376ea51

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plibflac-0.1.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 134.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.1.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cef4b225c4c9263bafa08507eabce7be308e6377222f8461d10a5687388e7310
MD5 f19913d512badb94593cbded1850d6c6
BLAKE2b-256 899121e8a9b73a31b6f4dd5a179ff94059b12d4f1b15827f5cb96947d70e49fe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plibflac-0.1.0-pp39-pypy39_pp73-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 150.2 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.1.0-pp39-pypy39_pp73-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 4e402fe2e33ce63cb7cdf20432e542e7ef1123a2b1c2728c03933ebab5cc8a73
MD5 5447538147446e3786a274559f8d0b9c
BLAKE2b-256 e5c2077a5957d7277dfe49e92b33bbd55f18dfa65bedf5ee03243ab659a4cd30

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plibflac-0.1.0-cp35-abi3-win_amd64.whl
  • Upload date:
  • Size: 106.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.1.0-cp35-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 bcebd96d2bc581cc20e009b9d1705e51dc068addb1657946da8c8f284ad13f32
MD5 7525eb151a18ef89ab4c4d1643fd6146
BLAKE2b-256 8f33099a7bfcf39c6cef9f873f8358a696a9fafc99649eefb9a494da347d2f82

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plibflac-0.1.0-cp35-abi3-win32.whl
  • Upload date:
  • Size: 96.0 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.1.0-cp35-abi3-win32.whl
Algorithm Hash digest
SHA256 7bf19c7878c85acb25d31616326b975114165227343fa8550e2a5fbc94a865a1
MD5 6396a79ce374875391e6337775b4678d
BLAKE2b-256 31d125f2b6bc6f7612f551bd88cff0049d8a00567b77529b0660d42645908f5b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plibflac-0.1.0-cp35-abi3-musllinux_1_2_x86_64.whl
  • Upload date:
  • Size: 523.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.1.0-cp35-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0ca3fe7baaef8efa4f694b55aceb1c8d447204ff368edd9fd33fa4fa648b061d
MD5 46297698024a8eebf594b56a1087bb99
BLAKE2b-256 87967c4fa3356f0716379e2e07ddd20ffca3787beba5306c0efd3dd90a561403

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plibflac-0.1.0-cp35-abi3-musllinux_1_2_i686.whl
  • Upload date:
  • Size: 522.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.1.0-cp35-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 b1226cb09227808ebe140d4e018271a9c12efae549a1e632c260bb4eed943b78
MD5 4509f2f1535aade1272223027598baaf
BLAKE2b-256 6bf66e5b92e4d6a88af5e6f6078100fa680d2c1152a6c5a950ce1dc9c4ca1d1b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plibflac-0.1.0-cp35-abi3-musllinux_1_2_aarch64.whl
  • Upload date:
  • Size: 496.9 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.1.0-cp35-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 720a7a6d37a37ce113fa28635f98533d2a195570dafef119e6c6f1d5f0a07d05
MD5 f9cd4d790ce206b22407cce3df8c87eb
BLAKE2b-256 c278b39ab9fb44f9eb317407ff8ea3f2a6f6d012835317c20b8d4a3e9adc573a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-0.1.0-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c5f4b63c30dad19250de1476bf2309fa0db7a9aeddbe26106e69bcb9b51f9f56
MD5 2fa53c8f61493f52976d3f730e4c2a6e
BLAKE2b-256 c2d96d261f970c9619676f063e9b941ac04ac57e94a97569ebf173544df548ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-0.1.0-cp35-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 04e96456fb8384624ff4a931c0fea39b633e2497222b7a996326121dd57856f1
MD5 4923266fd6842f4cbecf47b58a7bc99b
BLAKE2b-256 42163f982881fa708db8045545f52f024afd5bae353cc5e2744b64c380eb07b0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-0.1.0-cp35-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 01690bacf4b51cd5d41f289a889d198f25916e6f77dcbd789bad2d17662be668
MD5 4c7b74f3b6b8ce2ffd30cbfdf4dd6207
BLAKE2b-256 8772979cf967b2987b34d5ec49fb37f3f5e944c71f3f0c451894b173eaaa7589

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plibflac-0.1.0-cp35-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 146.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.1.0-cp35-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 68da9473841302272a41e5638a9f1883d2802e7129ee840619bdd572c5e1e263
MD5 528fb4353f9f25ad8870fe8f82cc9b3b
BLAKE2b-256 45265f157ca15f66303fc926ac8a595d115106a886cae627548aa4f3386d27da

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plibflac-0.1.0-cp35-abi3-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 164.2 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.1.0-cp35-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 00cedebf9af4c9fc5838d07572ef86b648e0ccc09000fba31df96de8a2961533
MD5 ac8cf0a12ae2ec15b15c92e4b1c8ec63
BLAKE2b-256 f217548b60e30e29aea98ad121fd7ac9149ad0d39d671d886e8fbb76d6a1e40f

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