Crates.io | raplay |
lib.rs | raplay |
version | 0.4.3 |
created_at | 2023-07-30 18:11:30.407593+00 |
updated_at | 2025-09-01 08:33:06.338761+00 |
description | Library for playing audio |
homepage | https://github.com/BonnyAD9/raplay |
repository | https://github.com/BonnyAD9/raplay |
max_upload_size | |
id | 930146 |
size | 151,645 |
Library for playing audio.
The library is very new and not much tested.
All the decoding is done by symphonia, so the supported formats are the same as symphonia.
use raplay::{Sink, source::Sine};
let mut sink = Sink::default(); // Get the default output
let src = Sine::new(1000.); // Create 1000Hz sine source
sink.load(Box::new(src), true)?; // Play the sine wave
# Ok::<(), raplay::Error>(())
use std::fs::File;
use raplay::{Sink, source::Symph};
let mut sink = Sink::default(); // Get the default output
let file = File::open("music.mp3").unwrap(); // Open the mp3 file
let src = Symph::try_new(file, &Default::default())?; // Create a symphonia
// decoder source
sink.load(Box::new(src), true); // Play the mp3 file
# Ok::<(), raplay::Error>(())
It is available on crates.io