Expand description
Deterministic mock audio sources (M-MEDIA.4 / AUT-100).
Enables TDD for waveform + histogram rendering without requiring a
microphone or GStreamer. Three shapes — sine wave, silence, step
pulse — emit timestamped AudioChunks with byte-exact reproducible
samples. Every M-MEDIA test that wants “this is what audio looks
like” without a live device uses one of these.
§Sources
SineWaveSource—sin(2π·f·t). Stable amplitude + frequency are the histogram’s “this RMS should be √2/2” reference.SilenceSource— all zeros. The histogram’s “this should quantize to zero bars” reference.StepPulseSource— a single 1.0 spike at a configurable frame index, otherwise zero. The histogram’s “this bucket should have a detectable peak” reference.
Each source is an iterator-like type with next_chunk(frames). It
advances an internal frame counter on each call; timestamps come
from MediaTime::from_sample.
Structs§
- Silence
Source - Silence source — emits all-zero samples.
- Sine
Wave Source - Sine-wave source. Emits
amplitude · sin(2π · frequency · t)on every channel. - Step
Pulse Source - Step-pulse source. Emits a single-frame
1.0spike atspike_frame_index; every other frame is0.0. Useful for histogram-peak assertions that need a known location.