Skip to content

Instantly share code, notes, and snippets.

@camwest
Created July 13, 2025 18:21
Show Gist options
  • Select an option

  • Save camwest/898ec2ba2354f52564122db872275b80 to your computer and use it in GitHub Desktop.

Select an option

Save camwest/898ec2ba2354f52564122db872275b80 to your computer and use it in GitHub Desktop.
Smart caching in video-to-transcript
// Smart caching in video-to-transcript
// From: https://github.com/camwest/video-to-transcript/blob/main/src/transcriber.ts#L46-L52
const responseFile = audioPath.replace(/\.[^.]+$/, '.deepgram.json');
if (!force && existsSync(responseFile)) {
console.log(`✓ Using existing transcription: ${responseFile}`);
try {
const responseText = readFileSync(responseFile, 'utf8');
const result = JSON.parse(responseText);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment