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
Release history Release notifications | RSS feed
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.2.tar.gz
(6.5 kB
view details)
File details
Details for the file wavchunk-1.0.2.tar.gz
.
File metadata
- Download URL: wavchunk-1.0.2.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f8eef0892332c7414f05f66609b3581281ab4aac5f0d4ae0858944eee6bf310 |
|
MD5 | 97f2826a34199d87b0edf6fa4d25a143 |
|
BLAKE2b-256 | ec8730b29d76ebb0e0982de1399d180dbbb1c445cec5038eda3d294f2c187e93 |