Audio file plugin for b2btest, a framework to test against checked outputs
Project description
b2btest audio - Audio file plugin for b2btest
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
Change log
b2btest audio 1.4.0
- Audio plugin separated from b2btest package
In earlier versions this plugin was distributed
as an optional plugin in b2btest
b2btest 1.3.3
- Simplified dependency on lxml
b2btest 1.3.2
diffaudio
as console scriptdiffxml
as console script- Fix: entry points for xml and audio plugins
- Just markdown README
b2btest 1.3.1
- Updated README
b2btest 1.3
- Avoid larg diffs by telling just the generated file with the failed results
- Fix unicode problems in certain python versions
- Using older lxml versions for python<3.5
b2btest 1.2
- CLI: Fix: only the first output was actually checked
- Plugin based type sensitive diff
- Specific diff for XML
- XML and Audio diffing now are extras
- 'extensions' key in yaml testcases to associate custom file extensions to a diff plugin
b2btest 1.1
- Unit test like usage for back-to-back test Python code instead of command line programs.
- New commandline tool
back2back
that takes a yaml file with the test cases definitions.
b2btest 1.0
- First github version
- (There were previous unpublished versions)
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 b2btest_audio-1.4.1.tar.gz
.
File metadata
- Download URL: b2btest_audio-1.4.1.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35988d0d3a6144986a347da737168210ce5e4b653af90869b856106847fcda0d |
|
MD5 | 8249cd410a0955c4665751f804793f97 |
|
BLAKE2b-256 | 8e4cae4d2833e11123315e861f5128799461156f1351a24f2187f3574a484be5 |
File details
Details for the file b2btest_audio-1.4.1-py3-none-any.whl
.
File metadata
- Download URL: b2btest_audio-1.4.1-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cde88067de2a77f174cfb1d10b00319a9db865d35b4fade17c94a4a162ec471d |
|
MD5 | 87e1aba74369d8e9a334d37aa22e7c32 |
|
BLAKE2b-256 | 45bf8ee743fd7f5efa906c87789032fe19bbcefa07febf3f4c69261cac332e7c |