pub struct Transcript {
pub text: String,
pub language: Option<String>,
pub duration: Option<f64>,
pub segments: Vec<Segment>,
pub words: Vec<Word>,
pub diarized: bool,
pub model: String,
pub provider: String,
}Fields§
§text: String§language: Option<String>ISO 639-1 where the provider says ("id", "en"); None when it
does not.
duration: Option<f64>Length of the audio in seconds, when reported.
segments: Vec<Segment>§words: Vec<Word>§diarized: boolWhether speakers were told apart. false means every speaker is
None because nobody looked, not because there was one speaker.
model: String§provider: StringImplementations§
Source§impl Transcript
impl Transcript
Sourcepub fn words_between(&self, start: f64, end: f64) -> Vec<&Word>
pub fn words_between(&self, start: f64, end: f64) -> Vec<&Word>
The words spoken between two moments — what a clip from start to
end contains. A word counts when any part of it is inside.
Sourcepub fn segments_between(&self, start: f64, end: f64) -> Vec<&Segment>
pub fn segments_between(&self, start: f64, end: f64) -> Vec<&Segment>
The segments that overlap a window, for cutting on sentence edges.
Sourcepub fn to_srt(&self) -> String
pub fn to_srt(&self) -> String
SubRip subtitles, one cue per segment. ffmpeg -vf subtitles= burns
this in.
pub fn to_json(&self) -> Json
Trait Implementations§
Source§impl Clone for Transcript
impl Clone for Transcript
Source§impl Debug for Transcript
impl Debug for Transcript
Source§impl PartialEq for Transcript
impl PartialEq for Transcript
impl StructuralPartialEq for Transcript
Auto Trait Implementations§
impl Freeze for Transcript
impl RefUnwindSafe for Transcript
impl Send for Transcript
impl Sync for Transcript
impl Unpin for Transcript
impl UnsafeUnpin for Transcript
impl UnwindSafe for Transcript
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