RavenRS · Rust GUI

AudioPlayerButton

Edit and run the AudioPlayerButton RavenRS example in your browser. Explore its Rust code and download a Cargo project for desktop and WebAssembly.

One declarative Rust interface, GPU rendering, reactive state and semantic design tokens. Free and open source under MIT OR Apache-2.0.

Rust source

fn audio_player_button() -> impl View {
    // A second of a low tone, computed here. An app delivers its own recording.
    let tone: Vec<f32> =
        (0..44_100).map(|i| (i as f32 / 44_100.0 * 220.0 * std::f32::consts::TAU).sin() * 0.2).collect();
    AudioPlayerButton::new()
        .clip(SoundClip::new(tone, 44_100))
        .transcript("What was said goes here, to open when wanted.")
        .width(320.0)
}

The interactive preview loads when JavaScript and WebGPU or WebGL2 are available. You can read the guide and examples here at any time.

More examples