pub struct AudioProperties {
pub gain: Animated<f32>,
pub pan: Animated<f32>,
pub fade_in: MediaTime,
pub fade_out: MediaTime,
pub fade_in_shape: FadeShape,
pub fade_out_shape: FadeShape,
pub muted: bool,
pub effects: Vec<AudioEffect>,
pub preserve_pitch: bool,
pub pitch_cents: f32,
pub stream: Option<u32>,
pub channel_map: Option<ChannelMap>,
}Expand description
Per-clip audio presentation controls.
Fields§
§gain: Animated<f32>Animated linear amplitude constrained to 0..=MAX_GAIN.
pan: Animated<f32>Animated stereo position from -1 (left) to 1 (right).
fade_in: MediaTimeFade-in duration measured from the clip’s timeline start. Non-negative.
fade_out: MediaTimeFade-out duration measured back from the clip’s timeline end. Non-negative.
fade_in_shape: FadeShapeCurve of the fade in.
fade_out_shape: FadeShapeCurve of the fade out.
muted: boolSilences this clip without removing it.
effects: Vec<AudioEffect>Ordered effects applied before the track bus, at most MAX_CHAIN_EFFECTS. None takes
a sidechain.
preserve_pitch: boolKeeps the clip’s pitch when its speed is not 1 by time-stretching instead of resampling. No effect at speed 1, on loops or on freezes.
pitch_cents: f32Shifts the clip’s pitch by this many cents (100 to a semitone, 1,200 to an octave) without
changing its length, within MAX_PITCH_CENTS either way. With preserve_pitch the
result sits this far from the source’s pitch; without it, this far from the pitch the
clip’s speed gives. The shift time-stretches and then resamples, so formants move with
the pitch: it suits speech and intervals of a few semitones, and sounds rougher on music
and over wide intervals. No effect on loops or on freezes.
stream: Option<u32>The source’s audio stream the clip plays, counted from 0 over the file’s audio streams in container order. Absent plays the stream the host picks by default.
channel_map: Option<ChannelMap>What each project channel plays of the stream’s channels. Absent plays every channel, folded by speaker position.
Implementations§
Source§impl AudioProperties
impl AudioProperties
Sourcepub fn is_audible(&self) -> bool
pub fn is_audible(&self) -> bool
Returns whether this clip can contribute signal at any timestamp.
Sourcepub fn read(
&self,
time_map: &TimeMap,
timeline_range: TimeRange,
source_range: TimeRange,
) -> AudioRead
pub fn read( &self, time_map: &TimeMap, timeline_range: TimeRange, source_range: TimeRange, ) -> AudioRead
How a clip with these controls reads source_range over timeline_range under
time_map.
With s the clip’s speed and r the ratio pitch_cents names, the pitch moves by r
with preserve_pitch and by s r without it, and the read stretches by the speed over
that. A stage whose factor is exactly 1 is left out: r is rational only at whole
octaves, so only there can it cancel against a speed.
A time curve has no one speed, so nothing cancels on it: it reads Stretched with
preserve_pitch, Resampled without, and PitchedAlong for any pitch_cents.