whisper.cpp is a C/C++ implementation of OpenAI's Whisper automatic speech recognition model for converting audio to text. It's faster and more efficient than the Python version.
Why Whisper.cpp?
- ✅ Completely free and private (no cloud needed)
- ✅ Fast (2-10x faster than Python Whisper)
- ✅ Runs on laptop, phone (Termux), or as web service
- ✅ Low resource usage (works on CPU, GPU optional)
- ✅ Cross-platform (Linux, macOS, Windows, Android)
git clone https://github.com/ggml-org/whisper.cpp.git
cd whisper.cpp
# Build
cmake -B build
cmake --build build -j --config Release# English-only models (faster, smaller)
sh ./models/download-ggml-model.sh base.en
sh ./models/download-ggml-model.sh small.en
# Multilingual models
sh ./models/download-ggml-model.sh base
sh ./models/download-ggml-model.sh medium./build/bin/whisper-cli -f samples/jfk.wavImportant: whisper-cli works best with 16-bit WAV files.
Use ffmpeg to convert your audio to the correct format:
ffmpeg -i input.mp3 -ar 16000 -ac 1 -c:a pcm_s16le output.wavParameters:
-ar 16000: Sample rate of 16kHz-ac 1: Mono audio (1 channel)-c:a pcm_s16le: 16-bit PCM encoding
| Model | Disk Size | Memory Usage | Accuracy |
|---|---|---|---|
| tiny | 75 MiB | ~273 MB | Fair (85%) |
| base | 142 MiB | ~388 MB | Good (90%) |
| small | 466 MiB | ~852 MB | Very good (94%) |
| medium | 1.5 GiB | ~2.1 GB | Excellent (97%) |
| large | 2.9 GiB | ~3.9 GB | Best (98%) |
- Phone: Use
tinyorbase - Laptop: Use
baseorsmallfor daily use - Server: Use
smallormedium - Technical content: Use at least
small, preferablymedium - Professional use: Use
large
./build/bin/whisper-cli -m models/ggml-base.en.bin -f samples/jfk.wav./build/bin/whisper-cli -m models/ggml-base.en.bin -f samples/jfk.wav -ml 1./build/bin/whisper-cli -m models/ggml-base.en.bin -f audio.wav -otxt./build/bin/whisper-cli -m models/ggml-base.en.bin -f audio.wav -l en# Download VAD model
./models/download-vad-model.sh silero-v5.1.2
# Use with whisper
./build/bin/whisper-cli \
--file ./samples/jfk.wav \
--model ./models/ggml-base.en.bin \
--vad \
--vad-model ./models/ggml-silero-v5.1.2.bincmake -B build -DGGML_CUDA=1
cmake --build build -j --config Releasecmake -B build -DWHISPER_COREML=1
cmake --build build -j --config Releasecmake -B build -DGGML_VULKAN=1
cmake --build build -j --config ReleaseReduce model size and memory usage:
# Quantize model
./build/bin/quantize models/ggml-base.en.bin models/ggml-base.en-q5_0.bin q5_0
# Use quantized model
./build/bin/whisper-cli -m models/ggml-base.en-q5_0.bin ./samples/jfk.wavLinux:
# Install dependencies
sudo apt install libavcodec-dev libavformat-dev libavutil-dev
# Build with FFmpeg
cmake -B build -DWHISPER_FFMPEG=yes
cmake --build build -j --config Release
# Now you can use various formats
./build/bin/whisper-cli --model models/ggml-base.en.bin --file audio.opusCommon options:
-f FILE: Input audio file-m MODEL: Model file path-t N: Number of threads (default: 4)-l LANG: Language code (e.g., "en", "es", "fr")-ml N: Maximum segment length in characters-otxt: Output to text file-oj: Output to JSON file--print-colors: Color-code transcription by confidence--vad: Enable Voice Activity Detection
Get full help:
./build/bin/whisper-cli -h| Device | Model | RAM | Time (1hr audio) | Best Use |
|---|---|---|---|---|
| Phone (Termux) | tiny | 2GB | ~2 hours | Voice memos |
| Phone (Termux) | base | 4GB | ~3 hours | Recordings |
| Laptop (CPU) | base | 4GB | ~30-60 min | General use |
| Laptop (CPU) | small | 4GB | ~45-90 min | Better accuracy |
| Laptop (CPU) | medium | 8GB | ~90-180 min | Technical content |
| Desktop (GPU) | large | 10GB | ~6-12 min | Production |
- Audio → Text: Transcription with Whisper.cpp
- Text → Markdown: Formatting with AI
#!/bin/bash
# audio2note.sh - Whisper.cpp + AI formatting
AUDIO_FILE="$1"
BASE_NAME=$(basename "$AUDIO_FILE" | sed 's/\.[^.]*$//')
WHISPER_MODEL="${WHISPER_MODEL:-$HOME/whisper.cpp/models/ggml-base.bin}"
# Step 1: Transcribe with whisper.cpp
echo "Transcribing with whisper.cpp..."
~/whisper.cpp/build/bin/whisper-cli \
-m "$WHISPER_MODEL" \
-f "$AUDIO_FILE" \
-l en \
-otxt \
-of "/tmp/${BASE_NAME}"
TRANSCRIPT=$(cat "/tmp/${BASE_NAME}.txt")
# Step 2: Format with AI (use your preferred AI service)
echo "Formatting notes with AI..."
# ... AI formatting code here ...
echo "✓ Notes saved to: ${BASE_NAME}.md"
rm "/tmp/${BASE_NAME}.txt"#!/bin/bash
# audio2note-ollama.sh - 100% free & private
AUDIO_FILE="$1"
BASE_NAME=$(basename "$AUDIO_FILE" | sed 's/\.[^.]*$//')
WHISPER_MODEL="${WHISPER_MODEL:-$HOME/whisper.cpp/models/ggml-base.bin}"
# Step 1: Transcribe
echo "Transcribing..."
~/whisper.cpp/build/bin/whisper-cli \
-m "$WHISPER_MODEL" \
-f "$AUDIO_FILE" \
-l en \
-otxt \
-of "/tmp/${BASE_NAME}"
TRANSCRIPT=$(cat "/tmp/${BASE_NAME}.txt")
# Step 2: Format with Ollama (local AI)
echo "Formatting notes..."
FORMATTED_NOTES=$(ollama run llama3.2 "Convert this transcript into well-structured markdown notes with headings, bullet points, and key takeaways:\n\n$TRANSCRIPT")
echo "$FORMATTED_NOTES" > "${BASE_NAME}.md"
echo "✓ Notes saved to: ${BASE_NAME}.md"
rm "/tmp/${BASE_NAME}.txt"# Convert to optimal format (16kHz mono WAV)
ffmpeg -i input.mp3 -ar 16000 -ac 1 output.wav
# Reduce background noise
ffmpeg -i input.mp3 -af "highpass=f=200, lowpass=f=3000" cleaned.mp3
# Normalize volume
ffmpeg -i input.mp3 -af "loudnorm" normalized.mp3- Better audio quality = better transcription
- Use at least
smallmodel for technical content - Use
mediumfor medical/legal terminology - Specify language with
-l enfor 20-30% speedup - Use initial prompt for context:
--prompt "This is about quantum physics"
Convert this transcript into markdown notes with clear structure and headings.
Convert this lecture transcript into comprehensive markdown notes:
- Main concepts as ## headings
- Supporting details as bullet points
- Important definitions in bold
- Examples in blockquotes
- Add a summary section at the end
Convert this meeting transcript into actionable notes:
- Decisions made
- Action items with owners
- Key discussion points
- Next steps
- Follow-up questions
Use clear markdown formatting.
Format this interview transcript:
- Identify speakers (Interviewer/Guest)
- Organize by topics discussed
- Highlight key insights
- Pull out memorable quotes
- Add timestamps if available
| Method | Transcription | Formatting | Total | Notes |
|---|---|---|---|---|
| Whisper.cpp + Ollama | $0.00 | $0.00 | $0.00 | 100% Free |
| Whisper.cpp + Claude API | $0.00 | $0.03 | $0.03 | Best quality |
| Whisper.cpp + ChatGPT | $0.00 | $0.02 | $0.02 | Alternative |
Bottom line: Transcription is FREE with Whisper.cpp!
# Clone repository
git clone https://github.com/ggerganov/whisper.cpp
cd whisper.cpp
# Build
cmake -B build
cmake --build build -j --config Release
# Download models
bash ./models/download-ggml-model.sh base# Install Termux from F-Droid
# Open Termux and run:
pkg update && pkg upgrade
pkg install git clang make cmake
# Clone and build
git clone https://github.com/ggerganov/whisper.cpp
cd whisper.cpp
cmake -B build
cmake --build build -j
# Download tiny model (lighter for phone)
bash ./models/download-ggml-model.sh tiny
# Set up storage access
termux-setup-storage
# Transcribe
./build/bin/whisper-cli -m models/ggml-tiny.bin -f ~/storage/shared/recording.wav -otxt# Download model
docker run -it --rm \
-v path/to/models:/models \
ghcr.io/ggml-org/whisper.cpp:main "./models/download-ggml-model.sh base /models"
# Transcribe audio
docker run -it --rm \
-v path/to/models:/models \
-v path/to/audios:/audios \
ghcr.io/ggml-org/whisper.cpp:main "whisper-cli -m /models/ggml-base.bin -f /audios/audio.wav"docker run -it --rm --gpus all \
-v path/to/models:/models \
-v path/to/audios:/audios \
ghcr.io/ggml-org/whisper.cpp:main-cuda "whisper-cli -m /models/ggml-base.bin -f /audios/audio.wav"Ensure your audio is in the correct format:
ffmpeg -i input.mp3 -ar 16000 -ac 1 -c:a pcm_s16le output.wav- Use a smaller model (e.g.,
tinyorbase) - Use quantization
- Process in chunks
- Close other applications
- Use GPU acceleration (CUDA, Metal, Vulkan)
- Use a smaller model
- Enable VAD to skip non-speech segments
- Increase thread count with
-tflag - Specify language with
-lfor faster processing
- Use better audio source
- Pre-process audio (denoise, normalize)
- Use larger Whisper model
- Specify language explicitly
- Add context with
--prompt
# Using pyannote.audio
from pyannote.audio import Pipeline
pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization")
diarization = pipeline("audio.wav")
# Output: Speaker A: 0s-15s, Speaker B: 15s-32s, etc.# Whisper with timestamps
./build/bin/whisper-cli -m models/ggml-base.bin -f audio.wav --output-srt
# Creates .srt subtitle file with timestamps# Auto-detect language
./build/bin/whisper-cli -m models/ggml-base.bin -f audio.wav
# Specify language
./build/bin/whisper-cli -m models/ggml-base.bin -f audio.wav -l es
# Translate to English
./build/bin/whisper-cli -m models/ggml-base.bin -f audio.wav --translateLaptop: 1-3x real-time (20-60 min for 1 hour audio) Desktop with GPU: 5-10x real-time (6-12 min for 1 hour audio) Phone (Termux): 0.5x real-time (2 hours for 1 hour audio with tiny model)
- FFmpeg - Audio processing
- yt-dlp - YouTube downloader
- Ollama - Local AI for formatting
- PyAnnote - Speaker diarization
- Install Whisper.cpp (5 min)
- Transcribe:
./build/bin/whisper-cli -m models/ggml-base.bin -f audio.mp3 -otxt - Format: Copy transcript to AI service
- Save: Copy result to
.mdfile
Time: 10 min setup, 2 min per file Cost: $0
- Install Whisper.cpp
- Install Ollama:
curl -fsSL https://ollama.com/install.sh | sh - Download model:
ollama pull llama3.2 - Save automation script
- Run:
./audio2note.sh lecture.mp3
Time: 30 min setup, fully automated Cost: $0 forever
- Set up Whisper.cpp on server
- Install Flask web app
- Access from any device
- Upload audio, download markdown
Time: 1-2 hours setup Cost: $0 with Ollama
Whisper.cpp is the ideal solution for:
- ✅ Free, private transcription
- ✅ Fast processing
- ✅ Cross-platform support
- ✅ Low resource requirements
- ✅ High accuracy
- ✅ Flexible deployment options
Best combination: Whisper.cpp for transcription + Ollama for formatting = 100% free, private, and powerful note-taking system!