feat(sound): added a simple sound player to the engine with api in the App struct and a component to store metadata

This commit is contained in:
lisk77 2025-10-23 15:14:38 +02:00
parent dfdffed745
commit dab38c1e32
8 changed files with 203 additions and 4 deletions

View file

@ -0,0 +1,13 @@
pub trait Audio {
fn new() -> Self
where
Self: Sized;
fn load(&mut self, name: &str, path: &str);
fn play(&mut self, name: &str, looped: bool);
fn pause(&mut self, name: &str);
fn stop(&mut self, name: &str);
fn stop_all(&mut self);
fn update(&mut self, dt: f32);
fn is_playing(&self, name: &str) -> bool;
fn set_volume(&mut self, name: &str, volume: f32);
}