[−][src]Struct quicksilver::sound::Sound
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]
path: impl AsRef<Path>
) -> impl Future<Item = Sound, Error = QuicksilverError>
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(&self) -> 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
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
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]
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> Downcast for T where
T: Any,
T: Any,