SAL
A C++ library for spatial audio.
|
#include <propagationline.h>
Public Member Functions | |
PropagationLine (const sal::Length distance, const sal::Time sampling_frequency, const sal::Length max_distance=100.0, const sal::InterpolationType=sal::InterpolationType::kRounding, const bool air_filters_active=false, const bool allow_attenuation_larger_than_one=false, const sal::Length reference_distance=kOneSampleDistance) noexcept | |
sal::Sample | attenuation () const noexcept |
sal::Length | distance () const noexcept |
void | SetAttenuation (const sal::Sample, const sal::Time ramp_time=0.0) noexcept |
sal::Time | current_latency () const noexcept |
sal::Time | target_latency () const noexcept |
void | SetAirFiltersActive (const bool) noexcept |
void | Write (const sal::Sample &sample) noexcept |
void | Write (const Sample *samples, const Int num_samples) noexcept |
sal::Sample | Read () const noexcept |
void | Read (const Int num_samples, Sample *output_data) const noexcept |
void | Tick () noexcept |
void | Tick (const Int num_samples) noexcept |
void | SetDistance (const sal::Length distance, const sal::Time ramp_time=0.0) noexcept |
void | Reset () noexcept |
Static Public Member Functions | |
static bool | Test () |
Static Public Attributes | |
static const Length | kOneSampleDistance = NAN |
This describes a simple propagation line. It has one input and one output and models the delay between them. It also models attenuation between these two points, following 1/r rule. This object can also handle changes in the propagation line length.
|
noexcept |
This constructs a PropagationLine
object. You need to feed the distance
between the two points (in [m]), the sampling_frequency
and the maximum distance you expect that this propagaiton line may have. The value of distance_update_step
is the length (in meters) by which the delay line length changes at each sample. A distance_update_step
of 0 will not change the delay line length. The value of attenuation_update_length
is the number of samples it takes to update the attenuation. A attenuation_update_length
of 0 will immediately change the attenuation of the delay line.
|
noexcept |
Returns the multiplicative attenuation of the propagation line
|
inlinenoexcept |
|
noexcept |
|
inlinenoexcept |
Returns the current read sample
Returns a set of num_samples
samples and writes them into output_data
.
[in] | num_samples | the number of samples to read. |
[out] | output_data | the output array |
|
noexcept |
Resets the state of the filter
|
noexcept |
|
noexcept |
This overrides the 1/r rule attenuation.
|
noexcept |
This resets the propagation line's length. It updates also the attenuation according to 1/r law. You need to be careful with this method, since if the distance is changed too fast, sound distortion will be observed.
|
inlinenoexcept |
|
static |
|
noexcept |
|
noexcept |
Ticks time to next sample
|
noexcept |
|
static |