#[non_exhaustive]pub enum AudioMixLayer {
Audio {
audio: AudioId,
skip: Duration,
take: Duration,
},
AudioMix {
mix: AudioMix,
skip: Duration,
take: Duration,
},
VolumeLinear {
start: Duration,
duration: Duration,
start_volume: Factor,
end_volume: Factor,
},
SineWave {
frequency: f32,
duration: Duration,
},
}Expand description
Represents an audio source component.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Audio
Play the cached audio.
The audio samples are adapted to the output format and added to the under layers result.
Fields
skip: DurationClip the start of the audio.
Set to Duration::ZERO to play from the start.
take: DurationClip the end of the audio. Does not add padding, if skip + take is greater than the audio length stops early.
Set to Duration::MAX to play to the end.
AudioMix
Play the mix.
This mix is sampled as an audio (computed), its effect layers do not affect the parent mix.
Fields
skip: DurationClip the start of the audio.
Set to Duration::ZERO to play from the start.
take: DurationClip the end of the audio. Does not add padding, if skip + take is greater than the audio length stops early.
Set to Duration::MAX to play to the end.
VolumeLinear
Linear volume transition.
When the playback is in range the volume is multiplied by the linear interpolation between start_volume and end_volume. The volume snaps
back to the output stream volume after the end, unless another volume control layer is in effect.
Fields
SineWave
Generate a sine wave sound.
Trait Implementations§
Source§impl Clone for AudioMixLayer
impl Clone for AudioMixLayer
Source§fn clone(&self) -> AudioMixLayer
fn clone(&self) -> AudioMixLayer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AudioMixLayer
impl Debug for AudioMixLayer
Source§impl<'de> Deserialize<'de> for AudioMixLayer
impl<'de> Deserialize<'de> for AudioMixLayer
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>,
Source§impl PartialEq for AudioMixLayer
impl PartialEq for AudioMixLayer
Source§impl Serialize for AudioMixLayer
impl Serialize for AudioMixLayer
impl StructuralPartialEq for AudioMixLayer
Auto Trait Implementations§
impl Freeze for AudioMixLayer
impl RefUnwindSafe for AudioMixLayer
impl Send for AudioMixLayer
impl Sync for AudioMixLayer
impl Unpin for AudioMixLayer
impl UnwindSafe for AudioMixLayer
Blanket Implementations§
Source§impl<T> AnyVarValue for T
impl<T> AnyVarValue for T
Source§fn clone_boxed(&self) -> BoxAnyVarValue
fn clone_boxed(&self) -> BoxAnyVarValue
Source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self and other are equal.Source§fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
other if both are of the same type.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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more