pub struct Sound {
track: AudioTrack,
}Expand description
An audio leaf: plays a clip’s span inside its placed window.
Authored with Sound::new plus the track shapers (with_gain,
with_fade_in, …), then composed exactly like a visual animation:
ⓘ
seq![
square.fade_in(),
Sound::new(narration), // plays while the next cells run
square.write(),
]Fields§
§track: AudioTrackImplementations§
Source§impl Sound
impl Sound
Sourcepub fn from_track(track: AudioTrack) -> Self
pub fn from_track(track: AudioTrack) -> Self
A sound from a shaped track (gain, fades, play range).
Sourcepub fn with_fade_in(self, secs: f64) -> Self
pub fn with_fade_in(self, secs: f64) -> Self
Fade in linearly over the first secs of the sound.
Sourcepub fn with_fade_out(self, secs: f64) -> Self
pub fn with_fade_out(self, secs: f64) -> Self
Fade out linearly over the last secs of the sound.
Sourcepub fn with_play_secs(self, range: Range<f64>) -> Self
pub fn with_play_secs(self, range: Range<f64>) -> Self
Play only the clip’s seconds within range — a content trim, unlike
the cell layer’s with_duration, which resamples the sound to fit a
new window length.
Sourcepub fn duration_secs(&self) -> f64
pub fn duration_secs(&self) -> f64
The sound’s natural window length: the clip’s play length.
Trait Implementations§
Source§impl IntoAnimNode for Sound
impl IntoAnimNode for Sound
Source§fn into_anim_node(self) -> AnimNode
fn into_anim_node(self) -> AnimNode
Lower this definition into its local runtime representation.
Auto Trait Implementations§
impl Freeze for Sound
impl RefUnwindSafe for Sound
impl Send for Sound
impl Sync for Sound
impl Unpin for Sound
impl UnsafeUnpin for Sound
impl UnwindSafe for Sound
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
impl<T> ConditionalSend for Twhere
T: Send,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
Converts
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> ⓘ
Converts
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§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.
§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<A> PlaybackExt for Awhere
A: Unplaced,
impl<A> PlaybackExt for Awhere
A: Unplaced,
Source§fn with_rate_func(self, rate_func: fn(f64) -> f64) -> Paramed<Self>
fn with_rate_func(self, rate_func: fn(f64) -> f64) -> Paramed<Self>
Change the animation’s rate function.
Source§fn with_duration(self, duration_secs: f64) -> Paramed<Self>
fn with_duration(self, duration_secs: f64) -> Paramed<Self>
Change the animation’s duration.
Source§fn with_enabled(self, enabled: bool) -> Paramed<Self>
fn with_enabled(self, enabled: bool) -> Paramed<Self>
Enable or disable this animation’s output.
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> TransformedExt for T
impl<T> TransformedExt for T
Source§fn transformed<G>(self, transform: G) -> Transformed<Self, G>
fn transformed<G>(self, transform: G) -> Transformed<Self, G>
Return
self wrapped with transform stored exactly as G.