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

Function formatSrt

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

Source from the content-addressed store, hash-verified

403}
404
405export function formatSrt(words: Word[], opts?: WordsToCuesOptions): string {
406 const cues = wordsToCues(words, opts);
407 if (cues.length === 0) return "";
408
409 return (
410 cues
411 .map(
412 (cue, i) =>
413 `${i + 1}\n${formatSrtTimestamp(cue.start)} --> ${formatSrtTimestamp(cue.end)}\n${cue.text}`,
414 )
415 .join("\n\n") + "\n"
416 );
417}
418
419export function formatVtt(words: Word[], opts?: WordsToCuesOptions): string {
420 const cues = wordsToCues(words, opts);

Callers 2

exportTranscriptFunction · 0.85
normalize.test.tsFile · 0.85

Calls 2

wordsToCuesFunction · 0.85
formatSrtTimestampFunction · 0.85

Tested by

no test coverage detected