class

FEchoTail

FEchoTail — the echo a space gives back, built from where the scanner's rays actually landed instead of a reverb preset per room. Every shot contributes its hit distances to a decaying histogram (0.5 m bins out to 64 m) and its misses to an "open air" weight. From that:

Module
Audio
Header
#include "Audio/EchoTail.h"
Namespace
Mowo
  • pre-delay = 2 * nearest well-populated distance / c; - decay (RT60) = the mean-free-path law with a fixed wall absorption, RT60 = 0.113 * meanDistance, shortened as more rays escape; - density = returned rays / all rays.

The estimate is published as the EchoDecay / EchoPreDelay / EchoDensity parameters, and BuildImpulseResponse synthesises a stereo IR from the same histogram — one early reflection per populated bin at its round-trip time, then a decorrelated noise tail decaying at the RT60. With a target submix set (SetTargetSubmix, or the audio.EchoTailSubmix cvar) a convolution reverb on that submix is rebuilt from the IR whenever the estimate moves enough, at most once a second. Main thread only; ticked by AudioEngine::UpdateVoices.

Properties

TypeNameDescription
static constexpr floatkSpeedOfSoundDefault 343.0f.
static constexpr floatkBinMetersDefault 0.5f.
static constexpr uint32_tkBinCountDefault 128.
static constexpr const char*kDecayParameterDefault "EchoDecay".
static constexpr const char*kPreDelayParameterDefault "EchoPreDelay".
static constexpr const char*kDensityParameterDefault "EchoDensity".

Public functions

ReturnsNameDescription
FEchoTail&Get
voidSubmitShotOne shot's hit distances (from its origin), out of rayCount rays; the rays that found nothing count as open air.
voidSetMemorySecondsSeconds for old evidence to fall to half its weight.
voidSetWallAbsorptionWhat the walls absorb, energy-weighted.
floatGetWallAbsorption
voidSetEarlyReflectionsExact early reflections from the geometry.
const std::vector<FEchoTap>&GetEarlyReflections
voidTick
voidReset
FEchoTailEstimateGetEstimate
voidBuildImpulseResponse
voidSetTargetSubmixEmpty clears the target and removes the reverb it placed.
const std::string&GetTargetSubmix
uint32_tGetRebuildCount
boolHasReverb
voidReleaseReverbTakes the reverb out of its submix and drops it; the target stays, so it is rebuilt on the next tick of a running engine.

Function details

Get

C++
static FEchoTail& Get()

SubmitShot

C++
void SubmitShot(const float* hitDistances, uint32_t hitCount, uint32_t rayCount, float weight = 1.0f)

One shot's hit distances (from its origin), out of rayCount rays; the rays that found nothing count as open air.

SetMemorySeconds

C++
void SetMemorySeconds(float seconds)

Seconds for old evidence to fall to half its weight.

SetWallAbsorption

C++
void SetWallAbsorption(float absorption)

What the walls absorb, energy-weighted. The scanner alone cannot know the materials and assumes painted concrete (0.3); geometric acoustics traces them and hands the real figure in.

GetWallAbsorption

C++
float GetWallAbsorption() const

SetEarlyReflections

C++
void SetEarlyReflections(const std::vector<FEchoTap>& taps)

Exact early reflections from the geometry. While any are set they replace the histogram's one-tap-per-bin guess in the impulse response; an empty list goes back to the guess.

GetEarlyReflections

C++
const std::vector<FEchoTap>& GetEarlyReflections() const

Tick

C++
void Tick(float deltaTime)

Reset

C++
void Reset()

GetEstimate

C++
FEchoTailEstimate GetEstimate() const

BuildImpulseResponse

C++
void BuildImpulseResponse(uint32_t sampleRate, float maxSeconds, uint32_t seed, std::vector<float>& outInterleavedStereo, uint32_t& outFrames) const

SetTargetSubmix

C++
void SetTargetSubmix(const std::string& submix, float wet = 0.35f, float dry = 1.0f)

Empty clears the target and removes the reverb it placed.

GetTargetSubmix

C++
const std::string& GetTargetSubmix() const

GetRebuildCount

C++
uint32_t GetRebuildCount() const

HasReverb

C++
bool HasReverb() const

ReleaseReverb

C++
void ReleaseReverb()

Takes the reverb out of its submix and drops it; the target stays, so it is rebuilt on the next tick of a running engine. AudioEngine::Shutdown calls it while the graph still exists.

Generated from Audio/EchoTail.h via audio.json · Oct 26, 2026Version 1.0.0