1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! 跨模块共享的领域类型与时间换算。
/// 一条带起止时间的字幕片段。
///
/// 时间轴统一使用**毫秒**,与 SRT 写入模块一致;
/// Whisper 原始输出为 centisecond(1 cs = 10 ms),经 [`centis_to_ms`] 转换后填入本结构。
/// 将 Whisper 时间戳从 **centisecond**(10 ms 为单位)转为 **毫秒**。
///
/// Whisper API 中 `start_timestamp` / `end_timestamp` 返回值的单位为 centisecond;
/// 负数会被钳制为 0。
///
/// # 示例
///
/// ```
/// use video_subtitle::types::centis_to_ms;
/// assert_eq!(centis_to_ms(100), 1_000); // 100 cs = 1 s
/// ```