b2btest audio - audio data support for back-to-back tests
This package adds audio file support to b2btest. b2btest is a tool to automate tests that compare results to some previous ones, and this plugin, is helpful to compare audiofiles in a sensible way.
See b2btest README for a deeper discussion on why you should avoid back-to-back testing, although sometimes it is the lesser evil way to proceed.
This plugin handles audiofiles specially in several ways:
- Instead of doing a text or byte difference, it interprets the audio contents and compares them sample by sample.
- It considers two outputs to be different if:
- Metadata differs
- Sample-by-sample differs relative to the audio level
- In the case of differences, it generates a diff audio by substracting both waves sample by sample.
By means of python-wavefile, it supports floating point samples, and multichannel waves.
How to install
Just use:
$ pip install b2btest_audio
Dependencies
This plugin requires the wavefile module, which in turn requires having libsndfile library installed in your system.
Back2Back testing of cli programs
When you are testing back-to-back the output of a command line, you define a yaml file like this (name it b2bcases.yaml).
#!/usr/bin/env back2back
datapath: "b2bdata" # Point it to the directory containing your reference data
testcases:
Generate1KHzSine:
command: sox -n /tmp/sine.wav synth 1.0 sine 1000.0
outputs:
- /tmp/sine.wav
Ouputs with supported audio file extension will be recognize and this plugin diff will be used for them.
See [b2btest] documentation on how to use this file.
Command line tool
The package also provides a diffaudio CLI tool to generate the audio difference
Metadata
Release files for b2btest-audio 1.4.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| b2btest_audio-1.4.3.tar.gz | 7.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| b2btest_audio-1.4.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.7 kB
Release files / b2btest_audio-1.4.3.tar.gz
| Download URL | b2btest_audio-1.4.3.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6f45d741547445a9a0b97c4b2c670d132edf0dbf13c40088e96ee3385e3af678
|
|
BLAKE2b-256 checksum How to use checksums |
4d0a1e9f165bfc20bd95124dcc87e99a906cade97d66aeec2c72856322484a87
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.9.20
|
Release files / b2btest_audio-1.4.3-py3-none-any.whl
| Download URL | b2btest_audio-1.4.3-py3-none-any.whl |
|---|---|
| Size | 7.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bfaddca22a66bd12a4d1cb7401381469a0c6dc0d8ccfa8656a379cf331ca1bf6
|
|
BLAKE2b-256 checksum How to use checksums |
83c31de65b0532baadf348cb5f72875cb7650ee3d19da75f51f1e4a5753a1acd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.9.20
|