Capítulo 748 de 988

Chapter 748: transcribe()

Core Idea

Transcribes a media file by utilizing Whisper. cpp.

Key Concepts

  • Options
  • inputPath
  • whisperPath
  • tokenLevelTimestamps<AvailableFrom v="4.0.131"/>
  • model?
  • modelFolder?
  • translateToEnglish?
  • printOutput?<AvailableFrom v="4.0.132" />

Code Examples

const {transcription} = await transcribe({
  inputPath: '/path/to/audio.wav',
  whisperPath: path.join(process.cwd(), 'whisper.cpp'),
  whisperCppVersion: '1.5.5',
  model: 'medium.en',
  tokenLevelTimestamps: true,
});

for (const token of transcription) {
  console.log(token.timestamps.from, token.timestamps.to, token.text);
}
  • What it demonstrates: Usage pattern for transcribe() from the official docs.

Key Takeaways

  1. Understand options when working with transcribe().
  2. Understand inputpath when working with transcribe().
  3. Understand whisperpath when working with transcribe().
  4. Understand tokenleveltimestamps<availablefrom v="4.0.131"/> when working with transcribe().
  5. Understand model? when working with transcribe().

Connects To

  • Convert to Captions: related page in the Whisper Web (@remotion/whisper-web) section.
  • Download Whisper Model: related page in the Whisper Web (@remotion/whisper-web) section.
  • Install Whisper cpp: related page in the Whisper Web (@remotion/whisper-web) section.