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.2.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.2-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: b2btest_audio-1.4.2.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.2.tar.gz
Algorithm Hash digest
SHA256 d085288d83681f74ae37487b6b9e6ce53b20487b06fd03d88c011ea7ddb47574
MD5 c0454d141c618b2540923e5e774de729
BLAKE2b-256 c8ca347954c20409c5441707b6815ec24f5003a10392b3fe04b97249e5e0da0c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: b2btest_audio-1.4.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e09324c2413c8dba9ccd094935fd2b8d9a0be6269f769c2b4e3bb3635d70ca25
MD5 4909fa8e7e721c0c62cd7a4d12a843cc
BLAKE2b-256 61b27d3b3495cb09ee24541c5b71496068e327b7c81e1c80f3e7c7f336187a69

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