Files
SubMiner/src/core/services/subtitle-generation-srt.ts
T
sudacode 2d623838d5 feat(subtitles): add local Japanese subtitle generation
- Generate Japanese SRTs through the overlay modal or launcher
- Support managed whisper.cpp models and optional dialogue detection
2026-09-07 21:43:53 -07:00

8 lines
446 B
TypeScript

export function formatTimestamp(milliseconds: number): string {
const rounded = Math.max(0, Math.round(milliseconds));
const hours = Math.floor(rounded / 3600000);
const minutes = Math.floor((rounded % 3600000) / 60000);
const seconds = Math.floor((rounded % 60000) / 1000);
return `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')},${String(rounded % 1000).padStart(3, '0')}`;
}