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, bar count, framerate, spectrum() snapshot. |
PhosphorAudio::CavaSpectrumProvider | cava-backed provider. Detects install, picks an audio method (PulseAudio / PipeWire / ALSA), builds a throwaway config, emits normalized FFT bars. |
auto* provider = new PhosphorAudio::CavaSpectrumProvider(parent);
provider->setBarCount(64);
provider->setFramerate(60);
QObject::connect(provider, &IAudioSpectrumProvider::spectrumUpdated,
shaderEffect, &MyShader::setBars);
provider->start();CavaSpectrumProvider shells out to cava, which handles PulseAudio / PipeWire / ALSA detection and owns the FFT. The lib parses its 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.