Skip to main content

Audio file support for b2btest, a framework to test against checked outputs

Project description

b2btest audio - audio data support for back-to-back tests

CI Coverage Status PyPI - Downloads PyPI - Version

B2BLogo

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

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

b2btest_audio-1.4.3.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

b2btest_audio-1.4.3-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file b2btest_audio-1.4.3.tar.gz.

File metadata

  • Download URL: b2btest_audio-1.4.3.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.20

File hashes

Hashes for b2btest_audio-1.4.3.tar.gz
Algorithm Hash digest
SHA256 6f45d741547445a9a0b97c4b2c670d132edf0dbf13c40088e96ee3385e3af678
MD5 e112686ceace05cbf39dea556cd9af04
BLAKE2b-256 4d0a1e9f165bfc20bd95124dcc87e99a906cade97d66aeec2c72856322484a87

See more details on using hashes here.

File details

Details for the file b2btest_audio-1.4.3-py3-none-any.whl.

File metadata

  • Download URL: b2btest_audio-1.4.3-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.20

File hashes

Hashes for b2btest_audio-1.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bfaddca22a66bd12a4d1cb7401381469a0c6dc0d8ccfa8656a379cf331ca1bf6
MD5 0a38f257fb0b2a5d2caab84917b6dbf4
BLAKE2b-256 83c31de65b0532baadf348cb5f72875cb7650ee3d19da75f51f1e4a5753a1acd

See more details on using hashes here.

Supported by

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