pub enum Volume {
Amplitude(f64),
Decibels(f64),
}
Expand description
A change in volume of a sound.
Variants§
Amplitude(f64)
All samples are multiplied by the specified factor.
Decibels(f64)
The volume is adjusted by the given number of decibels.
Implementations§
source§impl Volume
impl Volume
sourcepub const MIN_DECIBELS: f64 = -60f64
pub const MIN_DECIBELS: f64 = -60f64
The minimum decibel value at which a sound is considered silent.
sourcepub fn as_amplitude(&self) -> f64
pub fn as_amplitude(&self) -> f64
Returns the volume as an amplitude.
sourcepub fn as_decibels(&self) -> f64
pub fn as_decibels(&self) -> f64
Returns the volume as a difference in the number of decibels.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Volume
impl<'de> Deserialize<'de> for Volume
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for Volume
impl PartialEq for Volume
impl Copy for Volume
impl StructuralPartialEq for Volume
Auto Trait Implementations§
impl RefUnwindSafe for Volume
impl Send for Volume
impl Sync for Volume
impl Unpin for Volume
impl UnwindSafe for Volume
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more