//! The `audio` crate stores all audio assets that need to be loaded during runtime use raylib::audio::RaylibAudio; #[expect(dead_code)] type Sound = raylib::audio::Sound<'static>; /// The `Audio` container initalizes the audio subsystem /// for raylib, leaks it (to gurentee audio is statically loaded), /// then loads all needed audio samples #[derive(Debug)] pub struct Audio {} impl Audio { pub(crate) fn load() -> crate::Result { // Phantom handle to the raylib audio subsystem // Raylib doesnt use a handle, but the rust bindings // have one to ensure memory safety. // // We must leak this handle after allocating it, // if we dont then all audio will be unloaded :( // // NOTE: would this cause issues if `Audio::load` was // called multiple times? let _handle = Box::leak(Box::new(RaylibAudio::init_audio_device()?)); // TODO: load audio samples //let example = handle.new_sound("example.ogg")?; Ok(Self {}) } }