[][src]Struct gate::Audio

pub struct Audio<A: AppAssetId> { /* fields omitted */ }

Struct for audio playback.

Methods

impl<A: AppAssetId> Audio<A>[src]

pub fn play_sound(&mut self, sound: A::Sound)[src]

Plays the given sound effect once.

pub fn play_music(&mut self, music: A::Music)[src]

Plays the given music once, replacing the currently playing music, if any.

pub fn loop_music(&mut self, music: A::Music)[src]

Continually loops the given music, replacing the currently playing music, if any.

pub fn stop_music(&mut self)[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.