HART  0.2.0
High level Audio Regression and Testing
Loading...
Searching...
No Matches
AudioTestBuilder< SampleType > Class Template Reference

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< DSPBase< SampleType >, typename std::decay< DSPType >::type >::value >::type *=0)
 Moves the DSP instance into the host.
 
 AudioTestBuilder (std::unique_ptr< DSPBase< SampleType > > dsp)
 Transfers the DSP smart pointer into the host.
 
AudioTestBuilderwithSampleRate (double sampleRateHz)
 Sets the sample rate for the test.
 
AudioTestBuilderwithBlockSize (size_t blockSizeFrames)
 Sets the block size for the test.
 
AudioTestBuilderwithValue (int id, double value)
 Sets the initial param value for the tested DSP.
 
AudioTestBuilderwithDuration (double durationSeconds)
 Sets the total duration of the input signal to be processed.
 
AudioTestBuilderwithDspPreparation (Preparation dspPreparation)
 Sets whether to call reset() and/or prepare() on DSP testee before rendering audio.
 
AudioTestBuilderwithSignalPreparation (Preparation signalPreparation)
 Sets whether to call reset() and/or prepare() on the input Signal before rendering audio.
 
AudioTestBuilderwithWarmUp (double warmUpDurationSeconds, Preparation signalPreparation=Preparation::none, Preparation dspPreparation=Preparation::none)
 Adds a warm‑up period before the main test.
 
AudioTestBuilderwithInputSignal (const SignalBase< SampleType > &signal)
 Sets the input signal for the test by copying it.
 
AudioTestBuilderwithInputSignal (SignalBase< SampleType > &&signal)
 Sets the input signal for the test by moving it.
 
AudioTestBuilderwithInputSignal (std::unique_ptr< SignalBase< SampleType > > signal)
 Sets the input signal for the test by transfering its smart pointer.
 
AudioTestBuilderwithInputSignal (std::function< void(AudioBuffer< SampleType > &)> signalFunction, const std::string &label={}, Loop loop=Loop::yes)
 Sets the input signal using a function-based signal definition.
 
AudioTestBuilderwithInputChannels (size_t numInputChannels)
 Sets arbitrary number of input channels.
 
AudioTestBuilderwithOutputChannels (size_t numOutputChannels)
 Sets arbitrary number of output channels.
 
AudioTestBuilderwithStereoInput ()
 Sets number of input channels to two.
 
AudioTestBuilderwithStereoOutput ()
 Sets number of output channels to two.
 
AudioTestBuilderwithMonoInput ()
 Sets number of input channels to one.
 
AudioTestBuilderwithMonoOutput ()
 Sets number of output channels to one.
 
AudioTestBuilderinMono ()
 Sets number of input and output channels to one.
 
AudioTestBuilderinStereo ()
 Sets number of input and output channels to two.
 
template<typename MatcherType >
AudioTestBuilderexpectTrue (MatcherType &&matcher)
 Adds an "expect" check using a Matcher object.
 
template<typename MatcherType >
AudioTestBuilderexpectFalse (MatcherType &&matcher)
 Adds a reversed "expect" check using a Matcher object.
 
template<typename MatcherType >
AudioTestBuilderassertTrue (MatcherType &&matcher)
 Adds an "assert" check using a Matcher object.
 
template<typename MatcherType >
AudioTestBuilderassertFalse (MatcherType &&matcher)
 Adds a reversed "assert" check using a Matcher object.
 
AudioTestBuilderexpectTrue (std::function< Condition(const AudioBuffer< SampleType > &)> matcherFunction, const std::string &label={})
 Adds an "expect" check using a function matcher.
 
AudioTestBuilderexpectTrue (std::function< Condition(const AudioBuffer< SampleType > &, const AudioBuffer< SampleType > &)> matcherFunction, const std::string &label={})
 Adds an "expect" check using a function matcher.
 
AudioTestBuilderexpectFalse (std::function< Condition(const AudioBuffer< SampleType > &)> matcherFunction, const std::string &label={})
 Adds a reversed "expect" check using a function matcher.
 
AudioTestBuilderexpectFalse (std::function< Condition(const AudioBuffer< SampleType > &, const AudioBuffer< SampleType > &)> matcherFunction, const std::string &label={})
 Adds a reversed "expect" check using a function matcher.
 
AudioTestBuilderassertTrue (std::function< Condition(const AudioBuffer< SampleType > &)> matcherFunction, const std::string &label={})
 Adds an "assert" check using a function matcher.
 
AudioTestBuilderassertTrue (std::function< Condition(const AudioBuffer< SampleType > &, const AudioBuffer< SampleType > &)> matcherFunction, const std::string &label={})
 Adds an "assert" check using a function matcher.
 
AudioTestBuilderassertFalse (std::function< Condition(const AudioBuffer< SampleType > &)> matcherFunction, const std::string &label={})
 Adds a reversed "assert" check using a function matcher.
 
AudioTestBuilderassertFalse (std::function< Condition(const AudioBuffer< SampleType > &, const AudioBuffer< SampleType > &)> matcherFunction, const std::string &label={})
 Adds a reversed "assert" check using a function matcher.
 
AudioTestBuildersaveOutputTo (const std::string &path, Save mode=Save::always, WavFormat wavFormat=WavFormat::pcm24)
 Enables saving output audio to a wav file.
 
AudioTestBuildersaveOutputTo (AudioBuffer< SampleType > &receivingBuffer)
 Enables saving output audio to a provided buffer.
 
AudioTestBuildersaveOutputTo (std::function< void(AudioBuffer< SampleType > &&)> outputBufferSink)
 Enables saving output audio via provided callback.
 
AudioTestBuildersavePlotTo (const std::string &path, Save mode=Save::always)
 Enables saving a plot to an SVG file.
 
AudioTestBuildersaveInputSignalTo (std::unique_ptr< SignalBase< SampleType > > &receivingSignal)
 Moves the input signal after the processing into the provided smart pointer.
 
AudioTestBuildersaveInputSignalTo (std::function< void(std::unique_ptr< SignalBase< SampleType > > &&)> inputSignalSink)
 Moves the input signal after the processing via provided callback.
 
AudioTestBuilderwithLabel (const std::string &testLabel)
 Adds a label to the test.
 
std::unique_ptr< DSPBase< SampleType > > process ()
 Performs the test.
 

Detailed Description

template<typename SampleType>
class hart::AudioTestBuilder< SampleType >

A DSP host used for building and running tests inside a test case.

Definition at line 52 of file hart_process_audio.hpp.

Constructor & Destructor Documentation

◆ AudioTestBuilder() [1/2]

template<typename SampleType >
template<typename DSPType >
AudioTestBuilder ( DSPType &&  dsp,
typename std::enable_if< ! std::is_lvalue_reference< DSPType && >::value &&std::is_base_of< DSPBase< SampleType >, typename std::decay< DSPType >::type >::value >::type *  = 0 
)
inline

Moves the DSP instance into the host.

DSP instance will be moved into this host, and then returned by process(), so you can re-use it. You can only pass a DSP by moving it, since some of the custom DSP wrappers can be non-copyable. If you do want to copy a DSP instance here, use its DSPBase::copy() method explicitly.

Parameters
dspYour DSP instance

Definition at line 61 of file hart_process_audio.hpp.

◆ AudioTestBuilder() [2/2]

template<typename SampleType >
AudioTestBuilder ( std::unique_ptr< DSPBase< SampleType > >  dsp)
inline

Transfers the DSP smart pointer into the host.

Use this if your DSP does not support copying or moving. It will be owned by this host, and then returned by process(), so you can re-use it.

Parameters
dspA smart pointer to your DSP instance

Definition at line 74 of file hart_process_audio.hpp.

Member Function Documentation

◆ withSampleRate()

template<typename SampleType >
AudioTestBuilder & withSampleRate ( double  sampleRateHz)
inline

Sets the sample rate for the test.

All the signals, effects and sub hosts are guaranteed to be initialized to this sample rate

Parameters
sampleRateHzSample rate in Hz. You can use frequency-related literails from Units.

Definition at line 82 of file hart_process_audio.hpp.

◆ withBlockSize()

template<typename SampleType >
AudioTestBuilder & withBlockSize ( size_t  blockSizeFrames)
inline

Sets the block size for the test.

Parameters
blockSizeFramesBlock size in frames (samples)

Definition at line 96 of file hart_process_audio.hpp.

◆ withValue()

template<typename SampleType >
AudioTestBuilder & withValue ( int  id,
double  value 
)
inline

Sets the initial param value for the tested DSP.

It will call DSP::setValue() for DSP under test

Parameters
idParameter ID (see DSP::setValue())
valueValue that needs to be set

Definition at line 109 of file hart_process_audio.hpp.

◆ withDuration()

template<typename SampleType >
AudioTestBuilder & withDuration ( double  durationSeconds)
inline

Sets the total duration of the input signal to be processed.

Parameters
durationSecondsof the signal in seconds. You can use time-related literails from Units.

Definition at line 118 of file hart_process_audio.hpp.

◆ withDspPreparation()

template<typename SampleType >
AudioTestBuilder & withDspPreparation ( Preparation  dspPreparation)
inline

Sets whether to call reset() and/or prepare() on DSP testee before rendering audio.

It is useful when you re-use your DSP instance, to control whether you want to preserve its pre-existing state. If you also request withWarmUp(), this call will only affect pre-warp-up preparation. Post-warm-up preparaton is selected via withWarmUp() args.

Definition at line 131 of file hart_process_audio.hpp.

◆ withSignalPreparation()

template<typename SampleType >
AudioTestBuilder & withSignalPreparation ( Preparation  signalPreparation)
inline

Sets whether to call reset() and/or prepare() on the input Signal before rendering audio.

It is useful when you re-use your Signal instance, to control whether you want to preserve its pre-existing state. If you also request withWarmUp(), this call will only affect pre-warp-up preparation. Post-warm-up preparaton is selected via withWarmUp() args.

Definition at line 141 of file hart_process_audio.hpp.

◆ withWarmUp()

template<typename SampleType >
AudioTestBuilder & withWarmUp ( double  warmUpDurationSeconds,
Preparation  signalPreparation = Preparation::none,
Preparation  dspPreparation = Preparation::none 
)
inline

Adds a warm‑up period before the main test.

The signal will be processed for this time, but no matchers will be invoked. This can be useful if your DSP uses parameter smoothers internally, that need to settle before performing the test, or has some sort of attack envelope stage, like a compressor, that you want to skip. This time will be added up with a regular test render run, i.e. processAudioWith (...).withDuration (100_ms).withWarmUp (10_ms) will result in 10 + 100 = 110 ms of total rendered audio.

Note
Calling saveOutputTo() (both for wav files and AudioBuffers) and savePlotTo() will always output the entire rendered piece of audio, including this warm-up stage.
Parameters
warmUpDurationSecondsDuration of the warm‑up in seconds
signalPreparationWhether to call reset() and/or prepare() on an input signal after the warm-up stage
dspPreparationWhether to call reset() and/or prepare() on the DSP testee after the warm-up stage

Definition at line 161 of file hart_process_audio.hpp.

◆ withInputSignal() [1/4]

template<typename SampleType >
AudioTestBuilder & withInputSignal ( const SignalBase< SampleType > &  signal)
inline

Sets the input signal for the test by copying it.

Parameters
signalInput signal, see Signals

Definition at line 178 of file hart_process_audio.hpp.

◆ withInputSignal() [2/4]

template<typename SampleType >
AudioTestBuilder & withInputSignal ( SignalBase< SampleType > &&  signal)
inline

Sets the input signal for the test by moving it.

Parameters
signalInput signal, see Signals

Definition at line 186 of file hart_process_audio.hpp.

◆ withInputSignal() [3/4]

template<typename SampleType >
AudioTestBuilder & withInputSignal ( std::unique_ptr< SignalBase< SampleType > >  signal)
inline

Sets the input signal for the test by transfering its smart pointer.

Note
The ownership of the smart pointer will be transferred to this class
Parameters
signalInput signal, see Signals

Definition at line 195 of file hart_process_audio.hpp.

◆ withInputSignal() [4/4]

template<typename SampleType >
AudioTestBuilder & withInputSignal ( std::function< void(AudioBuffer< SampleType > &)>  signalFunction,
const std::string &  label = {},
Loop  loop = Loop::yes 
)
inline

Sets the input signal using a function-based signal definition.

Parameters
signalFunctionFunction that generates the signal buffer. It will moved to a Signal object.
labelHuman-readable label for the signal to use in the test error output
loopDetermines whether the generated buffer should loop

This overload constructs a SignalFunction internally, allowing inline definition of signals without explicitly creating a Signal object, for slightly less verbose syntax.

The function must have the signature: void (AudioBuffer<SampleType>&)

This method echoes the ctor of the hart::SignalFunction class, so see its documentaion for more detailed description.

Note
To re-use the signal made with your function, you can use saveInputSignalTo().
See also
SignalFunction

Definition at line 218 of file hart_process_audio.hpp.

◆ withInputChannels()

template<typename SampleType >
AudioTestBuilder & withInputChannels ( size_t  numInputChannels)
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.

Parameters
numInputChannelsNumber of input channels

Definition at line 236 of file hart_process_audio.hpp.

◆ withOutputChannels()

template<typename SampleType >
AudioTestBuilder & withOutputChannels ( size_t  numOutputChannels)
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.

Parameters
numOutputChannelsNumber of output channels

Definition at line 252 of file hart_process_audio.hpp.

◆ withStereoInput()

template<typename SampleType >
AudioTestBuilder & withStereoInput ( )
inline

Sets number of input channels to two.

Definition at line 265 of file hart_process_audio.hpp.

◆ withStereoOutput()

template<typename SampleType >
AudioTestBuilder & withStereoOutput ( )
inline

Sets number of output channels to two.

Definition at line 271 of file hart_process_audio.hpp.

◆ withMonoInput()

template<typename SampleType >
AudioTestBuilder & withMonoInput ( )
inline

Sets number of input channels to one.

Definition at line 277 of file hart_process_audio.hpp.

◆ withMonoOutput()

template<typename SampleType >
AudioTestBuilder & withMonoOutput ( )
inline

Sets number of output channels to one.

Definition at line 283 of file hart_process_audio.hpp.

◆ inMono()

template<typename SampleType >
AudioTestBuilder & inMono ( )
inline

Sets number of input and output channels to one.

Definition at line 289 of file hart_process_audio.hpp.

◆ inStereo()

template<typename SampleType >
AudioTestBuilder & inStereo ( )
inline

Sets number of input and output channels to two.

Definition at line 295 of file hart_process_audio.hpp.

◆ expectTrue() [1/3]

template<typename SampleType >
template<typename MatcherType >
AudioTestBuilder & expectTrue ( MatcherType &&  matcher)
inline

Adds an "expect" check using a Matcher object.

Parameters
matcherMatcher to perform the check, see Matchers

Definition at line 303 of file hart_process_audio.hpp.

◆ expectFalse() [1/3]

template<typename SampleType >
template<typename MatcherType >
AudioTestBuilder & expectFalse ( MatcherType &&  matcher)
inline

Adds a reversed "expect" check using a Matcher object.

Parameters
matcherMatcher to perform the check, see Matchers

Definition at line 312 of file hart_process_audio.hpp.

◆ assertTrue() [1/3]

template<typename SampleType >
template<typename MatcherType >
AudioTestBuilder & assertTrue ( MatcherType &&  matcher)
inline

Adds an "assert" check using a Matcher object.

Parameters
matcherMatcher to perform the check, see Matchers

Definition at line 321 of file hart_process_audio.hpp.

◆ assertFalse() [1/3]

template<typename SampleType >
template<typename MatcherType >
AudioTestBuilder & assertFalse ( MatcherType &&  matcher)
inline

Adds a reversed "assert" check using a Matcher object.

Parameters
matcherMatcher to perform the check, see Matchers

Definition at line 330 of file hart_process_audio.hpp.

◆ expectTrue() [2/3]

template<typename SampleType >
AudioTestBuilder & expectTrue ( std::function< Condition(const AudioBuffer< SampleType > &)>  matcherFunction,
const std::string &  label = {} 
)
inline

Adds an "expect" check using a function matcher.

Intended for simple inline expressions. For anything more than that, consider making a custom hart::Matcher subclass and use it instead.

See also
MatcherFunction
Parameters
matcherFunctionFunction with signature:
Container for audio data.
A class representing some condition.

Example:

[] (const AudioBuffer<SampleType>& output) { return HART_LESS_THAN (crestFactorDb (output), 3_dB); }
#define HART_LESS_THAN(lhs, rhs)
Parameters
labelOptional label used in failure reports

Definition at line 352 of file hart_process_audio.hpp.

◆ expectTrue() [3/3]

template<typename SampleType >
AudioTestBuilder & expectTrue ( std::function< Condition(const AudioBuffer< SampleType > &, const AudioBuffer< SampleType > &)>  matcherFunction,
const std::string &  label = {} 
)
inline

Adds an "expect" check using a function matcher.

Intended for simple inline expressions. For anything more than that, consider making a custom hart::Matcher subclass and use it instead.

See also
MatcherFunction
Parameters
matcherFunctionFunction with signature:

Example:

[] (const AudioBuffer<SampleType>& input, const AudioBuffer<SampleType>& output)
{
return HART_LESS_THAN (crestFactorDb (output), crestFactorDb (input));
}
Parameters
labelOptional label used in failure reports
Note
If your matcher function only cares about the output, and not the input, just use the overload that takes Condition (const AudioBuffer<SampleType>& output).

Definition at line 377 of file hart_process_audio.hpp.

◆ expectFalse() [2/3]

template<typename SampleType >
AudioTestBuilder & expectFalse ( std::function< Condition(const AudioBuffer< SampleType > &)>  matcherFunction,
const std::string &  label = {} 
)
inline

Adds a reversed "expect" check using a function matcher.

Intended for simple inline expressions. For anything more than that, consider making a custom hart::Matcher subclass and use it instead.

See also
MatcherFunction
Parameters
matcherFunctionFunction with signature:

Example:

[] (const AudioBuffer<SampleType>& output) { return HART_LESS_THAN (crestFactorDb (output), 3_dB); }
Parameters
labelOptional label used in failure reports

Definition at line 396 of file hart_process_audio.hpp.

◆ expectFalse() [3/3]

template<typename SampleType >
AudioTestBuilder & expectFalse ( std::function< Condition(const AudioBuffer< SampleType > &, const AudioBuffer< SampleType > &)>  matcherFunction,
const std::string &  label = {} 
)
inline

Adds a reversed "expect" check using a function matcher.

Intended for simple inline expressions. For anything more than that, consider making a custom hart::Matcher subclass and use it instead.

See also
MatcherFunction
Parameters
matcherFunctionFunction with signature:

Example:

[] (const AudioBuffer<SampleType>& input, const AudioBuffer<SampleType>& output)
{
return HART_LESS_THAN (crestFactorDb (output), crestFactorDb (input));
}
Parameters
labelOptional label used in failure reports
Note
If your matcher function only cares about the output, and not the input, just use the overload that takes Condition (const AudioBuffer<SampleType>& output).

Definition at line 421 of file hart_process_audio.hpp.

◆ assertTrue() [2/3]

template<typename SampleType >
AudioTestBuilder & assertTrue ( std::function< Condition(const AudioBuffer< SampleType > &)>  matcherFunction,
const std::string &  label = {} 
)
inline

Adds an "assert" check using a function matcher.

Intended for simple inline expressions. For anything more than that, consider making a custom hart::Matcher subclass and use it instead.

See also
MatcherFunction
Parameters
matcherFunctionFunction with signature:

Example:

[] (const AudioBuffer<SampleType>& output) { return HART_LESS_THAN (crestFactorDb (output), 3_dB); }
Parameters
labelOptional label used in failure reports

Definition at line 440 of file hart_process_audio.hpp.

◆ assertTrue() [3/3]

template<typename SampleType >
AudioTestBuilder & assertTrue ( std::function< Condition(const AudioBuffer< SampleType > &, const AudioBuffer< SampleType > &)>  matcherFunction,
const std::string &  label = {} 
)
inline

Adds an "assert" check using a function matcher.

Intended for simple inline expressions. For anything more than that, consider making a custom hart::Matcher subclass and use it instead.

See also
MatcherFunction
Parameters
matcherFunctionFunction with signature:

Example:

[] (const AudioBuffer<SampleType>& input, const AudioBuffer<SampleType>& output)
{
return HART_LESS_THAN (crestFactorDb (output), crestFactorDb (input));
}
Parameters
labelOptional label used in failure reports
Note
If your matcher function only cares about the output, and not the input, just use the overload that takes Condition (const AudioBuffer<SampleType>& output).

Definition at line 465 of file hart_process_audio.hpp.

◆ assertFalse() [2/3]

template<typename SampleType >
AudioTestBuilder & assertFalse ( std::function< Condition(const AudioBuffer< SampleType > &)>  matcherFunction,
const std::string &  label = {} 
)
inline

Adds a reversed "assert" check using a function matcher.

Intended for simple inline expressions. For anything more than that, consider making a custom hart::Matcher subclass and use it instead.

See also
MatcherFunction
Parameters
matcherFunctionFunction with signature:

Example:

[] (const AudioBuffer<SampleType>& output) { return HART_LESS_THAN (crestFactorDb (output), 3_dB); }
Parameters
labelOptional label used in failure reports

Definition at line 484 of file hart_process_audio.hpp.

◆ assertFalse() [3/3]

template<typename SampleType >
AudioTestBuilder & assertFalse ( std::function< Condition(const AudioBuffer< SampleType > &, const AudioBuffer< SampleType > &)>  matcherFunction,
const std::string &  label = {} 
)
inline

Adds a reversed "assert" check using a function matcher.

Intended for simple inline expressions. For anything more than that, consider making a custom hart::Matcher subclass and use it instead.

See also
MatcherFunction
Parameters
matcherFunctionFunction with signature:

Example:

[] (const AudioBuffer<SampleType>& input, const AudioBuffer<SampleType>& output)
{
return HART_LESS_THAN (crestFactorDb (output), crestFactorDb (input));
}
Parameters
labelOptional label used in failure reports
Note
If your matcher function only cares about the output, and not the input, just use the overload that takes Condition (const AudioBuffer<SampleType>& output).

Definition at line 509 of file hart_process_audio.hpp.

◆ saveOutputTo() [1/3]

template<typename SampleType >
AudioTestBuilder & saveOutputTo ( const std::string &  path,
Save  mode = Save::always,
WavFormat  wavFormat = WavFormat::pcm24 
)
inline

Enables saving output audio to a wav file.

Note
If you're using withWarmUp(), this warm-up section of audio will also be included in the output file
Parameters
pathFile path - relative or absolute. If relative path is set, it will be appended to the provided --data-root-path CLI argument.
modeWhen to save, see hart::Save
wavFormatFormat of the wav file, see hart::WavFormat for supported options
See also
HART_REQUIRES_DATA_PATH_ARG

Definition at line 520 of file hart_process_audio.hpp.

◆ saveOutputTo() [2/3]

template<typename SampleType >
AudioTestBuilder & saveOutputTo ( AudioBuffer< SampleType > &  receivingBuffer)
inline

Enables saving output audio to a provided buffer.

Note
If you're using withWarmUp(), this warm-up section of audio will also be included in the output buffer

Tip: You can use HART_STR() to construct file names using "<<" syntax.

Warning
The target directory has to exist!
Parameters
receivingBufferAn output buffer to receive the data. You can pass an unitialised buffer, among other things, as it will be move-assigned.

Definition at line 536 of file hart_process_audio.hpp.

◆ saveOutputTo() [3/3]

template<typename SampleType >
AudioTestBuilder & saveOutputTo ( std::function< void(AudioBuffer< SampleType > &&)>  outputBufferSink)
inline

Enables saving output audio via provided callback.

Note
If you're using withWarmUp(), this warm-up section of audio will also be included in the output buffer

Tip: You can use HART_STR() to construct file names using "<<" syntax.

Warning
The target directory has to exist!
Parameters
outputBufferSinkA callable that accepts a buffer rvalue. The buffer is moved into the provided sink. The test runner takes ownership of the callable object.

Definition at line 551 of file hart_process_audio.hpp.

◆ savePlotTo()

template<typename SampleType >
AudioTestBuilder & savePlotTo ( const std::string &  path,
Save  mode = Save::always 
)
inline

Enables saving a plot to an SVG file.

This will plot an input and output audio as a waveform

Note
If you're using withWarmUp(), this warm-up section of audio will also be included in the plot Tip: You can use HART_STR() to construct file names using "<<" syntax.
Parameters
pathFile path - relative or absolute. If relative path is set, it will be appended to the provided --data-root-path CLI argument.
modeWhen to save, see hart::Save
See also
HART_REQUIRES_DATA_PATH_ARG

Definition at line 564 of file hart_process_audio.hpp.

◆ saveInputSignalTo() [1/2]

template<typename SampleType >
AudioTestBuilder & saveInputSignalTo ( std::unique_ptr< SignalBase< SampleType > > &  receivingSignal)
inline

Moves the input signal after the processing into the provided smart pointer.

It's useful if you want to re-use your signal, query it for something, or extract some DSP instance from its DSP chain after the test.

Parameters
receivingSignalA smart pointer that will receive the moved signal

Definition at line 578 of file hart_process_audio.hpp.

◆ saveInputSignalTo() [2/2]

template<typename SampleType >
AudioTestBuilder & saveInputSignalTo ( std::function< void(std::unique_ptr< SignalBase< SampleType > > &&)>  inputSignalSink)
inline

Moves the input signal after the processing via provided callback.

It's useful if you want to re-use your signal, query it for something, or extract some DSP instance from its DSP chain after the test.

Parameters
inputSignalSinkA callable that accepts the moved signal

Definition at line 592 of file hart_process_audio.hpp.

◆ withLabel()

template<typename SampleType >
AudioTestBuilder & withLabel ( const std::string &  testLabel)
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. Tip: You can use HART_STR() to construct label strings using "<<" syntax.

Parameters
testLabelAny text, to be used as a label

Definition at line 603 of file hart_process_audio.hpp.

◆ process()

template<typename SampleType >
std::unique_ptr< DSPBase< SampleType > > process ( )
inline

Performs the test.

Call this after setting all the test parameters

Definition at line 611 of file hart_process_audio.hpp.


The documentation for this class was generated from the following file: