|
HART
0.1.0
High level Audio Regression and Testing
|
A DSP host used for building and running tests inside a test case. More...
#include <hart_process_audio.hpp>
Public Member Functions | |
| template<typename DSPType > | |
| AudioTestBuilder (DSPType &&dsp, typename std::enable_if< std::is_lvalue_reference< DSPType && >::value &&std::is_base_of< DSP< SampleType >, typename std::decay< DSPType >::type >::value >::type *=0) | |
| Copies the DSP instance into the host. | |
| template<typename DSPType > | |
| AudioTestBuilder (DSPType &&dsp, typename std::enable_if< ! std::is_lvalue_reference< DSPType && >::value &&std::is_base_of< DSP< SampleType >, typename std::decay< DSPType >::type >::value >::type *=0) | |
| Moves the DSP instance into the host. | |
| AudioTestBuilder (std::unique_ptr< DSP< SampleType > > dsp) | |
| Transfers the DSP smart pointer into the host. | |
| AudioTestBuilder & | withSampleRate (double sampleRateHz) |
| Sets the sample rate for the test. | |
| AudioTestBuilder & | withBlockSize (size_t blockSizeFrames) |
| Sets the block size for the test. | |
| AudioTestBuilder & | withValue (int id, double value) |
| Sets the initial param value for the tested DSP. | |
| AudioTestBuilder & | withDuration (double durationSeconds) |
| Sets the total duration of the input signal to be processed. | |
| AudioTestBuilder & | withInputSignal (const Signal< SampleType > &signal) |
| Sets the input signal for the test. | |
| AudioTestBuilder & | withInputChannels (size_t numInputChannels) |
| Sets arbitrary number of input channels. | |
| AudioTestBuilder & | withOutputChannels (size_t numOutputChannels) |
| Sets arbitrary number of output channels. | |
| AudioTestBuilder & | withStereoInput () |
| Sets number of input channels to two. | |
| AudioTestBuilder & | withStereoOutput () |
| Sets number of output channels to two. | |
| AudioTestBuilder & | withMonoInput () |
| Sets number of input channels to one. | |
| AudioTestBuilder & | withMonoOutput () |
| Sets number of output channels to one. | |
| AudioTestBuilder & | inMono () |
| Sets number of input and output channels to one. | |
| AudioTestBuilder & | inStereo () |
| Sets number of input and output channels to two. | |
| AudioTestBuilder & | expectTrue (const Matcher< SampleType > &matcher) |
| Adds an "expect" check. | |
| template<typename MatcherType > | |
| AudioTestBuilder & | expectTrue (MatcherType &&matcher) |
| Adds an "expect" check. | |
| AudioTestBuilder & | expectFalse (const Matcher< SampleType > &matcher) |
| Adds a reversed "expect" check. | |
| template<typename MatcherType > | |
| AudioTestBuilder & | expectFalse (MatcherType &&matcher) |
| Adds a reversed "expect" check. | |
| AudioTestBuilder & | assertTrue (const Matcher< SampleType > &matcher) |
| Adds an "assert" check. | |
| template<typename MatcherType > | |
| AudioTestBuilder & | assertTrue (MatcherType &&matcher) |
| Adds an "assert" check. | |
| AudioTestBuilder & | assertFalse (const Matcher< SampleType > &matcher) |
| Adds a reversed "assert" check. | |
| template<typename MatcherType > | |
| AudioTestBuilder & | assertFalse (MatcherType &&matcher) |
| Adds a reversed "assert" check. | |
| AudioTestBuilder & | saveOutputTo (const std::string &path, Save mode=Save::always, WavFormat wavFormat=WavFormat::pcm24) |
| Enables saving output audio to a wav file. | |
| AudioTestBuilder & | savePlotTo (const std::string &path, Save mode=Save::always) |
| Enables saving a plot to an SVG file. | |
| AudioTestBuilder & | withLabel (const std::string &testLabel) |
| Adds a label to the test. | |
| std::unique_ptr< DSP< SampleType > > | process () |
| Perfoems the test. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| template<typename DSPType > | |
| AudioTestBuilder< typename std::decay< DSPType >::type::SampleTypePublicAlias > | processAudioWith (DSPType &&dsp) |
| Call this to start building your test. | |
| template<typename DSPType > | |
| AudioTestBuilder< typename DSPType::SampleTypePublicAlias > | processAudioWith (std::unique_ptr< DSPType > &&dsp) |
| Call this to start building your test. | |
A DSP host used for building and running tests inside a test case.
Definition at line 38 of file hart_process_audio.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
Sets the sample rate for the test.
All the signals, effects and sub hosts are guaranteed to be initialized to this sample rate
| sampleRateHz | Sample rate in Hz. You can use frequency-related literails from Units. |
Definition at line 79 of file hart_process_audio.hpp.
|
inline |
Sets the block size for the test.
| blockSizeFrames | Block size in frames (samples) |
Definition at line 93 of file hart_process_audio.hpp.
|
inline |
Sets the initial param value for the tested DSP.
It will call DSP::setValue() for DSP under test
| id | Parameter ID (see DSP::setValue()) |
| value | Value that needs to be set |
Definition at line 106 of file hart_process_audio.hpp.
|
inline |
Sets the total duration of the input signal to be processed.
| Duration | of the signal in seconds. You can use time-related literails from Units. |
Definition at line 115 of file hart_process_audio.hpp.
|
inline |
Sets the input signal for the test.
| signal | Input signal, see Signals |
Definition at line 126 of file hart_process_audio.hpp.
|
inline |
Sets arbitrary number of input channels.
For common mono and stereo cases, you may use dedicated methods like inStereo() or withMonoInput() instead of this one for better readability.
| numInputChannels | Number of input channels |
Definition at line 137 of file hart_process_audio.hpp.
|
inline |
Sets arbitrary number of output channels.
For common mono and stereo cases, you may use dedicated methods like inMono() or withStereoOutput() instead of this one for better readability.
| numOutputChannels | Number of output channels |
Definition at line 153 of file hart_process_audio.hpp.
|
inline |
Sets number of input channels to two.
Definition at line 166 of file hart_process_audio.hpp.
|
inline |
Sets number of output channels to two.
Definition at line 172 of file hart_process_audio.hpp.
|
inline |
Sets number of input channels to one.
Definition at line 178 of file hart_process_audio.hpp.
|
inline |
Sets number of output channels to one.
Definition at line 184 of file hart_process_audio.hpp.
|
inline |
Sets number of input and output channels to one.
Definition at line 190 of file hart_process_audio.hpp.
|
inline |
Sets number of input and output channels to two.
Definition at line 196 of file hart_process_audio.hpp.
|
inline |
Adds an "expect" check.
Definition at line 203 of file hart_process_audio.hpp.
|
inline |
Adds an "expect" check.
Definition at line 212 of file hart_process_audio.hpp.
|
inline |
Adds a reversed "expect" check.
Definition at line 226 of file hart_process_audio.hpp.
|
inline |
Adds a reversed "expect" check.
Definition at line 235 of file hart_process_audio.hpp.
|
inline |
Adds an "assert" check.
Definition at line 248 of file hart_process_audio.hpp.
|
inline |
Adds an "assert" check.
Definition at line 257 of file hart_process_audio.hpp.
|
inline |
Adds a reversed "assert" check.
Definition at line 270 of file hart_process_audio.hpp.
|
inline |
Adds a reversed "assert" check.
Definition at line 279 of file hart_process_audio.hpp.
|
inline |
Enables saving output audio to a wav file.
| path | File path - relative or absolute. If relative path is set, it will be appended to the provided --data-root-path CLI argument. |
| mode | When to save, see hart::Save |
| wavFormat | Format of the wav file, see hart::WavFormat for supported options |
Definition at line 295 of file hart_process_audio.hpp.
|
inline |
Enables saving a plot to an SVG file.
This will plot an input and output audio as a waveform
| path | File path - relative or absolute. If relative path is set, it will be appended to the provided --data-root-path CLI argument. |
| mode | When to save, see hart::Save |
Definition at line 311 of file hart_process_audio.hpp.
|
inline |
Adds a label to the test.
Useful when you call process() multiple times in one test case - the label will be put into test failure report to indicate exactly which test has failed.
| testLabel | Any text, to be used as a label |
Definition at line 325 of file hart_process_audio.hpp.
|
inline |
Perfoems the test.
Call this after setting all the test parameters
Definition at line 333 of file hart_process_audio.hpp.