pub trait Audio: Send + Sync {
    // Required methods
    fn create_source(
        &mut self,
        entity: Entity,
        data: &[u8],
        streaming: bool,
        looped: bool,
        playback_rate: Scalar,
        volume: Scalar,
        play: bool,
        notify_ready: Arc<AtomicBool>
    );
    fn destroy_source(&mut self, entity: Entity);
    fn has_source(&mut self, entity: Entity) -> bool;
    fn update_source(
        &mut self,
        entity: Entity,
        looped: bool,
        playback_rate: Scalar,
        volume: Scalar,
        play: Option<bool>
    );
    fn get_source_state(&self, entity: Entity) -> Option<AudioState>;
    fn get_asset_id(&self, path: &str) -> Option<AssetId>;

    // Provided method
    fn update_cache(&mut self, _assets: &AssetsDatabase) { ... }
}

Required Methods§

source

fn create_source( &mut self, entity: Entity, data: &[u8], streaming: bool, looped: bool, playback_rate: Scalar, volume: Scalar, play: bool, notify_ready: Arc<AtomicBool> )

source

fn destroy_source(&mut self, entity: Entity)

source

fn has_source(&mut self, entity: Entity) -> bool

source

fn update_source( &mut self, entity: Entity, looped: bool, playback_rate: Scalar, volume: Scalar, play: Option<bool> )

source

fn get_source_state(&self, entity: Entity) -> Option<AudioState>

source

fn get_asset_id(&self, path: &str) -> Option<AssetId>

Provided Methods§

source

fn update_cache(&mut self, _assets: &AssetsDatabase)

Implementors§