[][src]Struct nuuro::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, volume: f32)[src]

Plays the given sound effect once.

The volume value 1.0 is the "normal" volume (unfiltered input). Any value other than 1.0 will multiply each sample by this value.

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

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

The volume value 1.0 is the "normal" volume (unfiltered input). Any value other than 1.0 will multiply each sample by this value.

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

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

The volume value 1.0 is the "normal" volume (unfiltered input). Any value other than 1.0 will multiply each sample by this value.

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> where
    A: Send

impl<A> Sync for Audio<A> where
    A: Sync

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> SetParameter for T

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.