simpleaudio.functionchecks

The functionchecks module contains a number of classes that all inherit from FunctionCheckBase which provides run() class method common toall function checks. These may be run individually with run() or all test may be run with run_all(). If the module is run from the command line using Python’s -m flag, it will automatically run all function checks.

API

simpleaudio.functionchecks.run_all(countdown=3)

Runs all function checks in succession.

Parameters:countdown (int) – the number of seconds to pause before running each test
class simpleaudio.functionchecks.FunctionCheckBase

A base class for all function checks.

FunctionCheckBase.run(countdown=0)

Runs a particular function check.

Parameters:countdown (int) – the number of seconds to pause before running the test
class simpleaudio.functionchecks.LeftRightCheck

Checks stereo playback by first playing a note in the left channel only, then a different note in the right channel only.

class simpleaudio.functionchecks.OverlappingCheck

Checks overlapped playback by playing three different notes spaced approximately a half-second apart but still overlapping.

class simpleaudio.functionchecks.StopCheck

Checks stopping playback by playing three different notes simultaneously and stopping two after approximately a half-second, leaving only one note playing for two more seconds.

class simpleaudio.functionchecks.StopAllCheck

Checks stopping playback of all audio by playing three different notes simultaneously and stopping all of them after approximately a half-second.

class simpleaudio.functionchecks.IsPlayingCheck

Checks functionality of the is_playing() method by calling during playback (when it should return True) and calling it again after all playback has stopped (when it should return False). The output is printed.

class simpleaudio.functionchecks.WaitDoneCheck

Checks functionality of the wait_done() method by using it to allow the three-note clip to play until finished (before attempting to stop playback).

Examples

Run all checks:

import simpleaudio.functionchecks as fc

fc.run_all()

Run a single check:

import simpleaudio.functionchecks as fc

fc.LeftRightCheck.run()