Transcribe
Transcribe audio files to text using Whisper.
Process
- Check audio format - Ensure file is in supported format (WAV, MP3, etc.)
- Convert if needed - Use ffmpeg to convert to WAV if necessary
- Choose model - Use smaller model for speed, larger for accuracy
- Run transcription - Use Whisper CLI or Python interface
- Extract text - Get the transcribed text output
- Review quality - Check transcription accuracy and fix obvious errors
Examples
# Whisper CLI (preferred if installed)
whisper /path/to/audio.wav --model small --output_format txt
cat /path/to/audio.txt
Python fallback
python3 - << 'PY'
try:
import whisper
except Exception:
raise SystemExit("whisper not installed")
model = whisper.load_model("small")
result = model.transcribe("/path/to/audio.wav")
print(result.get("text", ""))
PY
Tips
- Use a smaller model for speed.
- Convert audio to WAV if needed:
ffmpeg -i input.mp3 output.wav.