Crates.io | rustpat |
lib.rs | rustpat |
version | 0.6.1 |
source | src |
created_at | 2020-11-08 03:44:02.577491 |
updated_at | 2021-05-21 02:48:38.101845 |
description | rustpat is a Rust library that makes playing audio simple. |
homepage | |
repository | https://github.com/tnewman/pat |
max_upload_size | |
id | 309795 |
size | 91,456 |
rustpat is a Rust library that makes playing audio simple. rustpat uses FFmpeg to provide robust support for virtually any audio format and SDL2 to play back audio.
Install Prerequisites before installing.
extern crate rustpat;
fn main() {
let pat = rustpat::PAT::new().unwrap();
// Play a file
pat.play("amerika.mpga").unwrap();
// Skip the current file
pat.skip().unwrap();
// Pause audio playback
pat.pause().unwrap();
// Resume audio playback
pat.resume().unwrap();
}