(data: Record<string, unknown>)
| 168 | } |
| 169 | |
| 170 | function parseOpenAI(data: Record<string, unknown>): Word[] { |
| 171 | const words = (data.words ?? []) as Array<{ |
| 172 | word?: string; |
| 173 | text?: string; |
| 174 | start?: number; |
| 175 | end?: number; |
| 176 | }>; |
| 177 | return words |
| 178 | .map((w) => ({ |
| 179 | text: (w.word ?? w.text ?? "").trim(), |
| 180 | start: round3(w.start ?? 0), |
| 181 | end: round3(w.end ?? 0), |
| 182 | })) |
| 183 | .filter((w) => w.text.length > 0); |
| 184 | } |
| 185 | |
| 186 | function parseSrt(content: string): Word[] { |
| 187 | // SRT doesn't have word-level timestamps — parse as phrase-level entries. |
no test coverage detected