Skip to main content

Read or write INFO chunks in WAV files

Project description

wav-chunk

Read or write INFO chunks from a RIFF WAV file.

Installation

$ pip install wavchunk

Dependencies

  • Python 3.6 or higher

Usage

By default, wavchunk adds or gets INFO chunk bytes after the WAV data chunk.

Add INFO chunk

import wavchunk

with open("infile.wav", "rb") as in_file:
    with open("outfile.wav", "wb") as out_file:
        wavchunk.add_chunk(in_file, "my data".encode(), out_file=out_file)

Get INFO chunk

import wavchunk

with open("infile.wav", "rb") as in_file:
    my_data = wavchunk.get_chunk(in_file).decode()
    print(my_data)

Command-Line Interface

The wavchunk module can also be used from the command-line. By default, WAV data is expected on stdin and is written to stdout so that commands can be chained together in a pipe.

Add INFO chunk

$ python3 -m wavchunk add --data 'my data' < infile.wav > outfile.wav

Get INFO chunk

$ python3 -m wavchunk get --data - < infile.wav
<data from chunk>

Delete INFO chunk

$ python3 -m wavchunk get --delete --data mydata.bin < infile.wav > outfile.wav

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

wavchunk-1.0.1.tar.gz (5.6 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: wavchunk-1.0.1.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.9

File hashes

Hashes for wavchunk-1.0.1.tar.gz
Algorithm Hash digest
SHA256 1c6a40bff1cdfd4e95ce8f54ddde9a4acb3075a1bc1e7da9854859983b4be270
MD5 4ee053dfeb42c4fc345491e7c92c3d19
BLAKE2b-256 0cab8cae43190606eb0c0e319e5949c4da83336f8ce2dc53cfd3ccec258e827b

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page