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();