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

Uploaded CPython 3.5+Windows x86-64

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

Uploaded CPython 3.5+Windows x86

plibflac-0.3.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-0.3.0-cp35-abi3-musllinux_1_2_i686.whl (718.6 kB view details)

Uploaded CPython 3.5+musllinux: musl 1.2+ i686

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

Uploaded CPython 3.5+musllinux: musl 1.2+ ARM64

plibflac-0.3.0-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (683.1 kB view details)

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

plibflac-0.3.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-0.3.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-0.3.0-cp35-abi3-macosx_11_0_arm64.whl (159.8 kB view details)

Uploaded CPython 3.5+macOS 11.0+ ARM64

plibflac-0.3.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-0.3.0.tar.gz.

File metadata

  • Download URL: plibflac-0.3.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.3.0.tar.gz
Algorithm Hash digest
SHA256 d3bc15df704da368d957813bb2386976e50a676e34ec2b99fb878a7461708657
MD5 144e599883b35fd9936a916ee822c6df
BLAKE2b-256 bae9a56b1895825fe3c38dc262723c7adfcc698aa20270380beb705241a088de

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plibflac-0.3.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-0.3.0-cp35-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b605377f5380944036f2338a5e31b6550b936a587f36b8a4fb3d8a49f62b424f
MD5 cbd40c96e4febbd4e4399e80475188cf
BLAKE2b-256 03630671255c7f16e189b87de09d2c1d9ccf9dcd329cd804abe8d3ee5a77e650

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plibflac-0.3.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-0.3.0-cp35-abi3-win32.whl
Algorithm Hash digest
SHA256 8f268502a83224dae75c02fd87fb9c4889f71e6cf7320092437a0956801ad1ea
MD5 585755d7bd1c078d3bd9424bdaf244e1
BLAKE2b-256 e81110748f32891eabdc9949a6aeada440a56573778d1489c3bff4850103ae8e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-0.3.0-cp35-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ce7fed39ffc35f9a0cf0628e8b9a5808b5439d68111d9d363d5cdfbb112e3029
MD5 e7281c4f7de929d4e85d1471172f3b57
BLAKE2b-256 4de6dde5ab77c8dd9c0f5abe2ff88e207de4c281b285a181b3c75071eb6c15ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-0.3.0-cp35-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 1bca7f9b42a91d9423a151f08ff2148f7d78d697d13a44501659caae53f5b961
MD5 99201c943b2fe538f49779fa8e993246
BLAKE2b-256 99b813f1e5a567a8bd3c059e0c927c6446321ea50c346f91046da05f48e0ae11

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-0.3.0-cp35-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 86685143898a1ea1cfa72d4886bda5d51d651216d1d363e1a9c7a9ad79e42515
MD5 92dbdbfd3d924c24cc1586f1a56c4561
BLAKE2b-256 056cd182fc6f5a28536199f528b722fe38a5becf44fb50237e19fd3c706eb695

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-0.3.0-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f266d731edcf2738c583126e7560d1a8c8e406acb37ee14e79d2b5838daf4e93
MD5 5cf91f3c969e77fd05f0615c6e1305b5
BLAKE2b-256 4382cb0737d24d5fc71c9a4c88f57e608d8725c2e23cb120ba2ea88496eb6574

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-0.3.0-cp35-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 92cc20949740cc312dd07c439d9859fc7d9164e9b16884f203746a25638b7f6c
MD5 f91a3bd939e6643cbb5c97301f251a11
BLAKE2b-256 f2611e3908afdb1a64e42dcbccbe834cb44d06e57cd056e9458d68fa04875160

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-0.3.0-cp35-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 0cd747fb53f8e7d6199c23c7847f4c2f5f32811d518f1221bb3ccd8644cf4b1f
MD5 960a5c68ef9bfb3b3a317c7c9034e419
BLAKE2b-256 7e391c66af39465cbd8c2f161257fd5155517a2a9087b599ca4933e15988b9f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-0.3.0-cp35-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f7b34c865acf3c79ea65fffe3f22d9d8fa087aa309c1af18b4478bfa42b88191
MD5 02d246c5223e9a8adf7033a56b2093b8
BLAKE2b-256 64d5e2194e6d09c5663b99f5e766592857f6428f0e09593df4a491aaaa0905fa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plibflac-0.3.0-cp35-abi3-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 b4002c55673a6ab7b469327d5376b64c15639cf49b83690bc06e7df9e1000bb2
MD5 c5c04ca3895b35730781e5bb3e44ebf8
BLAKE2b-256 e419223c273b707431b479a18d86d08481d28e0219e18f18a233edce281acc50

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