[][src]Struct quicksilver::sound::Sound

pub struct Sound { /* fields omitted */ }

A clip of sound, which may be streamed from disc or stored in memory

It can be played an arbitrary amount of times and concurrently with itself, meaning you don't need more than one instance of a clip. However, if you want different clips with different volumes, you can clone the Sound.

Methods

impl Sound[src]

pub fn load(
    path: impl AsRef<Path>
) -> impl Future<Item = Sound, Error = QuicksilverError>
[src]

Start loading a sound from a given path

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

Get the volume of the sound clip instance

The volume is multiplicative, meaing 1 is the identity, 0 is silent, 2 is twice the amplitude, etc. Note that sound is not perceived linearly so results may not correspond as expected.

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

Set the volume of the sound clip instance

The volume is multiplicative, meaing 1 is the identity, 0 is silent, 2 is twice the amplitude, etc. Note that sound is not perceived linearly so results may not correspond as expected.

pub fn play(&self) -> Result<()>[src]

Play the sound clip at its current volume

The sound clip can be played over itself.

Future changes in volume will not change the sound emitted by this method.

Trait Implementations

impl Clone for Sound[src]

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

Performs copy-assignment from source. Read more

impl Debug for Sound[src]

Auto Trait Implementations

impl Send for Sound

impl Sync for Sound

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

impl<T> Erased for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T> Downcast for T where
    T: Any