(segments: TranscriptSegment[])
| 640 | } |
| 641 | |
| 642 | function formatTranscriptWithTimestamps(segments: TranscriptSegment[]): string { |
| 643 | return segments |
| 644 | .map((s) => { |
| 645 | const startTime = formatTime(s.start); |
| 646 | const endTime = formatTime(s.start + s.duration); |
| 647 | return `[${startTime}-${endTime}] ${s.text}`; |
| 648 | }) |
| 649 | .join('\n'); |
| 650 | } |
| 651 | |
| 652 | function formatTime(seconds: number): string { |
| 653 | const mins = Math.floor(seconds / 60); |
no test coverage detected