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.