mirror of
https://github.com/lisk77/comet.git
synced 2025-12-16 02:28:49 +00:00
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:
parent
dfdffed745
commit
dab38c1e32
8 changed files with 203 additions and 4 deletions
13
crates/comet_sound/src/audio.rs
Normal file
13
crates/comet_sound/src/audio.rs
Normal 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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue