Audio spectrum input for audio-reactive shaders and overlays.
A lightweight audio-spectrum feed for shader effects and QML overlays. One contract (IAudioSpectrumProvider) and one bundled implementation that shells out to the user's cava install. Consumers wire the emitted bar vector into a ShaderEffect UBO.
| Type | Purpose |
|---|---|
PhosphorAudio::IAudioSpectrumProvider | Provider contract: start, stop, options()/setOptions() (full SpectrumOptions parameter set), spectrum() snapshot. |
PhosphorAudio::CavaSpectrumProvider | cava-backed provider. Detects install, auto-picks PipeWire or PulseAudio (other backends such as ALSA via the inputMethod override), builds a throwaway config, emits normalized FFT bars. |
auto* provider = new PhosphorAudio::CavaSpectrumProvider(parent);
PhosphorAudio::SpectrumOptions options;
options.barCount = 64;
options.framerate = 60;
provider->setOptions(options);
QObject::connect(provider, &IAudioSpectrumProvider::spectrumUpdated,
shaderEffect, &MyShader::setBars);
provider->start();CavaSpectrumProvider spawns cava, which owns the audio capture and the FFT. The lib picks PipeWire or PulseAudio (or an explicit inputMethod override) for the generated config and parses cava's framed byte output.isAvailable() returns false when cava is not installed. Consumers should hide or disable audio-reactive overlays in that case rather than hard-fail.QtCoreIUniformExtension.