[][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.

Implementations

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 Clone for Output[src]

impl Debug for Output[src]

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.

Auto Trait Implementations

impl RefUnwindSafe for Output

impl Send for Output

impl Sync for Output

impl Unpin for Output

impl UnwindSafe for Output

Blanket Implementations

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

impl<T> Any for T where
    T: Any

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

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

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

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

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

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

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

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryDefault for T where
    T: Default

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<V, T> VZip<V> for T where
    V: MultiLane<T>,