wayle-cava 0.1.2

Real-time audio frequency visualization
docs.rs failed to build wayle-cava-0.1.2
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

wayle-cava

Real-time audio frequency visualization via libcava.

Crates.io docs.rs License: MIT

cargo add wayle-cava

Usage

CavaService captures system audio and produces frequency bar amplitudes. The values field updates at the configured framerate (default 60fps).

use wayle_cava::{CavaService, InputMethod};
use futures::StreamExt;

async fn example() -> Result<(), wayle_cava::Error> {
    let cava = CavaService::builder()
        .bars(32)
        .framerate(30)
        .input(InputMethod::PipeWire)
        .build()
        .await?;

    let mut stream = cava.values.watch();
    while let Some(values) = stream.next().await {
        println!("Bars: {:?}", &values[..4]);
    }
    Ok(())
}

Runtime changes like set_bars() and set_noise_reduction() restart the capture automatically. The vendored feature (on by default) compiles libcava from source.

License

MIT

Part of wayle-services.