MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / formatVtt

Function formatVtt

packages/cli/src/whisper/normalize.ts:419–432  ·  view source on GitHub ↗
(words: Word[], opts?: WordsToCuesOptions)

Source from the content-addressed store, hash-verified

417}
418
419export function formatVtt(words: Word[], opts?: WordsToCuesOptions): string {
420 const cues = wordsToCues(words, opts);
421 if (cues.length === 0) return "WEBVTT\n\n";
422
423 return (
424 "WEBVTT\n\n" +
425 cues
426 .map(
427 (cue) => `${formatVttTimestamp(cue.start)} --> ${formatVttTimestamp(cue.end)}\n${cue.text}`,
428 )
429 .join("\n\n") +
430 "\n"
431 );
432}
433
434// ---------------------------------------------------------------------------
435// Public API

Callers 2

exportTranscriptFunction · 0.85
normalize.test.tsFile · 0.85

Calls 2

wordsToCuesFunction · 0.85
formatVttTimestampFunction · 0.85

Tested by

no test coverage detected