Skip to main content

Module live

Module live 

Source
Expand description

Live audio visualization: records audio from an input device and shows it in a real-time GUI window (egui).

Start with LiveVisualizer; see the live_visualize_* examples in examples/. Run this only with --release, otherwise it is very laggy.

§What the window shows

The upper chart is the recorded audio, the lower chart a Transform of it, e.g. a lowpass-filtered waveform or a frequency spectrum. Both cover the last five seconds and scroll from right (now) to left.

Recording is always mono. A stereo device is averaged down to one channel, so a transformation always receives a single sequence of amplitudes, and each chart shows a single signal.

A waveform is drawn as a filled shape from the smallest to the largest amplitude per pixel column, not as a line through individual samples: a column covers a few hundred samples at common sample rates. See crate::WaveformVisualizer for why that is the right thing to show.

Structs§

AudioInput
The audio input device and stream configuration used for recording.
LiveVisualizer
Builder that opens a GUI window showing the live waveform of an audio input device along with a custom Transform of it.

Enums§

Transform
Transformation of the recorded audio, displayed in the lower half of the LiveVisualizer window.

Type Aliases§

PointsFn
Closure type of Transform::Points.
WaveformFn
Closure type of Transform::Waveform.