Python modules for handling the Broadcast Wave Format and RF64 files.
Project description
wave-bwf-rf64
Python modules for handling the Broadcast Wave Format and RF64 files.
Installing:
$ pip install wave-bwf-rf64
Basic example:
import contextlib
import wave_bwf_rf64
with contextlib.closing(wave_bwf_rf64.open("input.wav", "rb")) as f:
print("Num frames:", f.getnframes())
Features
This package gives you the ability to work with both BWF and RF64 compatible WAV-files in Python.
Supported file IDs (first four bytes):
- RIFF
- RF64
Supported WAVE formats:
- PCM
Supported chunk types:
- ds64
- fmt
- data
- bext
- axml
- MD5
- levl
- chna
- r64m (only when reading)
This package's scope is limited to BWF and RF64 WAV files in the PCM format. Feature requests and pull requests for other types of (WAV) files are outside of this scope and would increase our maintenance burden if accepted. They will therefore not be considered. You are, however, more than welcome to publish such additions in a fork of your own.
Compatibility
This project requires Python version 3.10 or higher.
Versioning
We use semantic versioning.
The Semantic Versioning Specification requires that we declare a public API. We may only introduce breaking changes to this public API if we simultaneously increment the major version. No such commitment is made for the parts of this project that are outside of the public API.
The public API is:
wave_bwf_rf64.open
wave_bwf_rf64.chunk.Chunk
wave_bwf_rf64.wave.
__all__
Error
WAVE_FORMAT_PCM
Bext
Chna
R64mMarker
R64m
Wave_read
Wave_write
open
- All methods and attributes of any classes mentioned above, where the method or attribute name does not start with an underscore (
!= _*
) - All methods and attributes of any classes mentioned above, where the method or attribute name is a system-defined name, i.e. their name starts and ends with two underscores (
== __*__
)
License
This project is licensed under the GNU General Public License version 3 or later. See LICENSE for details.
wave-bwf-rf64
is a modified version of BBC's wave-bwf
project.
The latter is, to the best of our knowledge, no longer available.
See the changelog for the history of this project, which spans back to 2014/2015.
Known issues
- There is no rendered documentation for the
open
function and the classes it may return - The
open
function does not acceptpathlib.Path
objects - The object returned by
open
is not a context manager, so it cannot be used with awith
statement directly - Issues where the size in the RIFF file header is too small or equal to 0, as may be the case when a recording was abruptly stopped or is accessed mid-recording, are not handled gracefully
- The project is lacking quality control
- The project is missing type annotations, so type checkers and IDEs may not help you so much
Specifications
- Primary specification: Recommendation ITU-R BS.2088-1
- Superseded specification containing information on the RF64 marker chunk (r64m): EBU-TECH 3306: MBWF/RF64: An extended File Format for Audio
Modules
chunk.py
The original Python module for handling RIFF chunks with extensions for handling RF64.
wave.py
Extension of the Python Standard Library's wave module with BWF handling added (bext, chna, axml, md5 and levl chunks).
Contributors
Thank you to:
- The Python Standard Library authors and contributors for the original
wave
andchunk
modules - David Marston (BBC) for the Broadcast Wave File support
- Tormod Værvågen (NRK) for the RF64 support and support for the
MD5
andlevl
chunks - John Arne Johnsen (NRK) for conversion to Python 3 and the addition of BEXT coding history field
- Thorben Werner Sjøstrøm Dahl (NRK) for the support for the
r64m
chunk (when reading) and preparations before publication
Todo
- Incorporate changes made to the chunk and wave modules in the Python Standard Library after this fork was made
- Adapt tests from the Python Standard Library and expand them with tests for the added functionality
- Adapt documentation from the Python Standard Library and expand it with descriptions of the added functionality
- Run tests and other quality control tools automatically
- Set up automatic release pipeline
- Refactor the user-facing API for easier use
- Refactor the internals, so that type checking works and the code is more readable
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
Built Distribution
File details
Details for the file wave_bwf_rf64-2.0.1.tar.gz
.
File metadata
- Download URL: wave_bwf_rf64-2.0.1.tar.gz
- Upload date:
- Size: 1.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5fdabc3dad4ebf7dd65d86b15acc8b8cce856a2c2032abcb55ac9bd79d58c5c |
|
MD5 | 0d3ced8be5f123bcb238ebdb871c848d |
|
BLAKE2b-256 | 41d717c4f9051b72cf114882b24fb82b057d1b37da6500492bc8d3a8bcfa5593 |
File details
Details for the file wave_bwf_rf64-2.0.1-py3-none-any.whl
.
File metadata
- Download URL: wave_bwf_rf64-2.0.1-py3-none-any.whl
- Upload date:
- Size: 39.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cea4c5df0c3dabf938d78dd1be3a89cc4ec32ea794fce35d63947164782efa8 |
|
MD5 | 14173ead86c6001ba892f8aa70944214 |
|
BLAKE2b-256 | 8dc5747b8764552336b1910f419d5aeef470844d556544a69972de10e7220ee9 |