pub struct Caption {
pub start_ms: u64,
pub end_ms: u64,
pub text: String,
}Expand description
一条带起止时间的字幕片段。
时间轴统一使用毫秒,与 SRT 写入模块一致;
Whisper 原始输出为 centisecond(1 cs = 10 ms),经 centis_to_ms 转换后填入本结构。
Fields§
§start_ms: u64字幕开始时间(毫秒,含)。
end_ms: u64字幕结束时间(毫秒,不含或含取决于播放器;本库保证 end_ms > start_ms)。
text: String字幕正文(已去除首尾空白)。
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Caption
impl RefUnwindSafe for Caption
impl Send for Caption
impl Sync for Caption
impl Unpin for Caption
impl UnsafeUnpin for Caption
impl UnwindSafe for Caption
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