[−][src]Struct amethyst_audio::AudioSink
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 Unpin for AudioSink
impl Sync for AudioSink
impl Send for AudioSink
impl UnwindSafe for AudioSink
impl RefUnwindSafe for AudioSink
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
[src]
fn is_in_subset(&self) -> bool
[src]
unsafe fn to_subset_unchecked(&self) -> SS
[src]
fn from_subset(element: &SS) -> SP
[src]
impl<T> Resource for T where
T: Any + Send + Sync,
[src]
T: Any + Send + Sync,
impl<T> Any for T where
T: Any,
[src]
T: Any,
fn get_type_id(&self) -> TypeId
[src]
impl<T> Event for T where
T: Send + Sync + 'static,
[src]
T: Send + Sync + 'static,