pub struct Audio<A: AppAssetId> { /* private fields */ }
Expand description
Struct for audio playback.
Implementations
sourceimpl<A: AppAssetId> Audio<A>
impl<A: AppAssetId> Audio<A>
sourcepub fn play_sound(&mut self, sound: A::Sound)
pub fn play_sound(&mut self, sound: A::Sound)
Plays the given sound effect once.
sourcepub fn play_music(&mut self, music: A::Music)
pub fn play_music(&mut self, music: A::Music)
Plays the given music once, replacing the currently playing music, if any.
sourcepub fn loop_music(&mut self, music: A::Music)
pub fn loop_music(&mut self, music: A::Music)
Continually loops the given music, replacing the currently playing music, if any.
sourcepub fn stop_music(&mut self)
pub fn stop_music(&mut self)
Stops the currently playing music, if any.
Auto Trait Implementations
impl<A> RefUnwindSafe for Audio<A>where
A: RefUnwindSafe,
impl<A> !Send for Audio<A>
impl<A> !Sync for Audio<A>
impl<A> Unpin for Audio<A>where
A: Unpin,
impl<A> UnwindSafe for Audio<A>where
A: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more