[][src]Struct tetra::audio::SoundInstance

pub struct SoundInstance { /* fields omitted */ }

A handle to a single instance of a Sound.

The audio thread will poll this for updates every 220 samples (roughly every 5ms at a 44100hz sample rate).

Note that dropping a SoundInstance does not stop playback.

Methods

impl SoundInstance
[src]

pub fn play(&self)
[src]

Plays the sound if it is stopped, or resumes the sound if it is paused.

pub fn stop(&self)
[src]

Stops the sound, and rewinds it to the beginning.

pub fn pause(&self)
[src]

Pauses the sound.

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

Sets the volume of the sound.

The parameter is used as a multiplier - for example, 1.0 would result in the sound being played back at its original volume.

pub fn set_speed(&self, speed: f32)
[src]

Sets the speed (and by extension, the pitch) of the sound.

The parameter is used as a multiplier - for example, 1.0 would result in the sound being played back at its original speed.

pub fn set_repeating(&self, repeating: bool)
[src]

Sets whether the sound should repeat or not.

pub fn toggle_repeating(&self)
[src]

Toggles whether the sound should repeat or not.

Trait Implementations

impl Clone for SoundInstance
[src]

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

Performs copy-assignment from source. Read more

impl Debug for SoundInstance
[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From for T
[src]

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

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

type Owned = T

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

impl<T> Same for T

type Output = T

Should always be Self

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

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.