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
- Understand options when working with transcribe().
- Understand inputpath when working with transcribe().
- Understand whisperpath when working with transcribe().
- Understand tokenleveltimestamps<availablefrom v="4.0.131"/> when working with transcribe().
- 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.