[][src]Struct amethyst_audio::output::Output

pub struct Output { /* fields omitted */ }

A speaker(s) through which audio can be played.

By convention, the default output is stored as a resource in the World.

Methods

impl Output[src]

pub fn name(&self) -> String[src]

Gets the name of the output

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

Play a sound once. A volume of 1.0 is unchanged, while 0.0 is silent.

This will return an Error if the loaded audio file in source could not be decoded.

pub fn play_once(&self, source: &Source, volume: f32)[src]

Play a sound once. A volume of 1.0 is unchanged, while 0.0 is silent.

This may silently fail, in order to get error information use try_play_once.

pub fn play_n_times(&self, source: &Source, volume: f32, n: u16)[src]

Play a sound n times. A volume of 1.0 is unchanged, while 0.0 is silent.

This may silently fail, in order to get error information use try_play_n_times.

pub fn try_play_n_times(
    &self,
    source: &Source,
    volume: f32,
    n: u16
) -> Result<(), DecoderError>
[src]

Play a sound n times. A volume of 1.0 is unchanged, while 0.0 is silent.

This will return an Error if the loaded audio file in source could not be decoded.

Trait Implementations

impl Eq for Output[src]

impl PartialEq<Output> for Output[src]

impl Clone for Output[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Default for Output[src]

Convenience method for opening the default output device.

Since most modern hardware features audio output, this implementation fails if a device can't be initialized. Use an alternative initialization scheme if running on hardware without an integrated audio chip.

impl Debug for Output[src]

Auto Trait Implementations

impl Send for Output

impl Sync for Output

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for 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> Resource for T where
    T: Any + Send + Sync

impl<T> Any for T where
    T: Any

impl<T> TryDefault for T where
    T: Default

fn unwrap_default() -> Self

Calls try_default and panics on an error case.

impl<T> Erased for T

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

impl<T> Clone for T where
    T: Clone
[src]