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

Function importTranscript

packages/cli/src/commands/transcribe.ts:153–172  ·  view source on GitHub ↗
(inputPath: string, dir: string, json: boolean)

Source from the content-addressed store, hash-verified

151}
152
153async function importTranscript(inputPath: string, dir: string, json: boolean): Promise<void> {
154 const { loadTranscript, patchCaptionHtml } = await import("../whisper/normalize.js");
155 const { words, format } = loadTranscript(inputPath);
156
157 if (words.length === 0) exitNoWords(json);
158
159 const outPath = join(dir, "transcript.json");
160 writeFileSync(outPath, JSON.stringify(words, null, 2));
161 patchCaptionHtml(dir, words);
162
163 if (json) {
164 console.log(
165 JSON.stringify({ ok: true, format, wordCount: words.length, transcriptPath: outPath }),
166 );
167 } else {
168 console.log(
169 `${c.success("◇")} Imported ${c.accent(String(words.length))} words from ${c.accent(format)} format → ${c.accent("transcript.json")}`,
170 );
171 }
172}
173
174// ---------------------------------------------------------------------------
175// Export transcript sidecars

Callers 1

runFunction · 0.85

Calls 3

loadTranscriptFunction · 0.85
exitNoWordsFunction · 0.85
patchCaptionHtmlFunction · 0.85

Tested by

no test coverage detected