pub struct AudioTrack {
pub path: String,
pub volume: f32,
pub start_ms: Option<u64>,
pub end_ms: Option<u64>,
pub loop_track: bool,
}Expand description
A background audio track to mix with the narration audio.
Tracks loop by default and play at 30% volume. Use the builder methods to customize.
§Example
use narrate_this::AudioTrack;
let track = AudioTrack::new("./music.mp3")
.volume(0.15)
.start_at(2000) // delay by 2 seconds
.no_loop();Fields§
§path: StringFile path to the audio file.
volume: f32Volume level from 0.0 (silent) to 1.0 (full). Default: 0.3.
start_ms: Option<u64>Optional delay before the track starts (milliseconds).
end_ms: Option<u64>Optional end time — the track is trimmed at this point (milliseconds).
loop_track: boolWhether to loop the track for the duration of the narration. Default: true.
Implementations§
Trait Implementations§
Source§impl Clone for AudioTrack
impl Clone for AudioTrack
Source§fn clone(&self) -> AudioTrack
fn clone(&self) -> AudioTrack
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AudioTrack
impl RefUnwindSafe for AudioTrack
impl Send for AudioTrack
impl Sync for AudioTrack
impl Unpin for AudioTrack
impl UnsafeUnpin for AudioTrack
impl UnwindSafe for AudioTrack
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