[][src]Struct amethyst_audio::AudioSink

pub struct AudioSink { /* fields omitted */ }

This structure provides a way to programmatically pick and play music.

Methods

impl AudioSink[src]

pub fn new(output: &Output) -> AudioSink[src]

Creates a new AudioSink using the given audio output.

pub fn append(&self, source: &Source) -> Result<(), DecoderError>[src]

Adds a source to the sink's queue of music to play.

pub fn empty(&self) -> bool[src]

Returns true if the sink has no more music to play.

pub fn volume(&self) -> f32[src]

Retrieves the volume of the sink, between 0.0 and 1.0;

pub fn set_volume(&mut self, volume: f32)[src]

Sets the volume of the sink.

pub fn play(&self)[src]

Resumes playback of a paused sink. Has no effect if this sink was never paused.

pub fn pause(&self)[src]

Pauses playback, this can be resumed with AudioSink::play

pub fn is_paused(&self) -> bool[src]

Returns true if the sink is currently paused.

pub fn stop(&self)[src]

Empties the sink's queue of all music.

Auto Trait Implementations

impl Send for AudioSink

impl Sync for AudioSink

Blanket Implementations

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.

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> Event for T where
    T: Send + Sync + 'static, 

impl<T> Resource for T where
    T: Any + Send + Sync

impl<T> Any for T where
    T: Any

impl<T> Erased for T