pub struct AudioVolumeOptions {
pub gain: f32,
pub muted: bool,
pub ramp_duration: Duration,
}Expand description
Construction-time settings for AudioVolume.
Fields§
§gain: f32Initial linear gain. 1.0 is unchanged, 0.5 is half amplitude,
and 0.0 is silence.
muted: boolWhether output starts muted. The configured gain is retained and
restored when the element is unmuted.
ramp_duration: DurationTime used to move from the current gain to a new runtime target.
A short ramp avoids the discontinuity heard as a click when gain or
mute changes in the middle of a waveform. Set to Duration::ZERO
for an immediate change.
Trait Implementations§
Source§impl Clone for AudioVolumeOptions
impl Clone for AudioVolumeOptions
Source§fn clone(&self) -> AudioVolumeOptions
fn clone(&self) -> AudioVolumeOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AudioVolumeOptions
Source§impl Debug for AudioVolumeOptions
impl Debug for AudioVolumeOptions
Auto Trait Implementations§
impl Freeze for AudioVolumeOptions
impl RefUnwindSafe for AudioVolumeOptions
impl Send for AudioVolumeOptions
impl Sync for AudioVolumeOptions
impl Unpin for AudioVolumeOptions
impl UnsafeUnpin for AudioVolumeOptions
impl UnwindSafe for AudioVolumeOptions
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