Learn German by building your own audio library from videos!
Goethe is a tool that helps you learn German by extracting specific sentences from your videos and saving them as MP3 files.
The Problem
I started learning German and wanted to use Anki for vocabulary practice. Anki is great for learning with audio, but I had a problem:
πΉ German learning videos (hours of content)
β
βοΈ I needed to cut specific sentences
β
π§ Convert them to MP3 files
β
π± Add them to Anki for practice
β
β° This took HOURS of manual work!
Every time I wanted to add a new sentence to Anki:
- I had to find the exact position in the video
- Cut the audio manually
- Convert it to MP3
- Save it with the right name
- Add it to Anki
This was wasting my study time. I wanted to learn German, not become a video editor!
The Solution
So I built Goethe to do all this work automatically:
πΉ German Lesson (30 min)
β
π You write: "Ich habe keine Zeit" in sentences.txt
β
π€ Goethe finds it in the video (2:15 - 2:18)
β
βοΈ Automatically cuts the audio
β
π΅ Creates: Ich_habe_keine_Zeit.mp3 (3 seconds)
β
π± Ready to add to Anki in seconds!
Now I can:
- β Learn German instead of editing videos
- β Build my Anki audio library quickly
- β Practice specific sentences anytime
- β Save hours of manual work
If you're learning German and using Anki, this tool is for you! π§
| Feature | Description |
|---|---|
| π€ Speech Recognition | Converts video speech to text with timestamps |
| π Smart Search | Finds sentences even with small differences (fuzzy matching) |
| π΅ MP3 Extraction | Creates high-quality audio clips (192 kbps) |
| π Organized Output | MP3 files organized by sentence in individual folders |
| π¨ Beautiful Interface | Colorful, professional output in your terminal |
| π Resume Support | Won't reprocess videos you've already done |
| β‘ Fast Processing | Uses optimized whisper models for speed |
| π Auto-Setup | Everything created automatically on first run |
| π©πͺ German Optimized | Handles Γ€, ΓΆ, ΓΌ, Γ and German grammar |
Before you start, make sure you have:
| Requirement | Version | How to check |
|---|---|---|
| Ubuntu | 22.04 or later | lsb_release -a |
| Python | 3.8 or later | python3 --version |
| FFmpeg | Latest | ffmpeg -version |
| Disk Space | 10+ GB free | df -h |
git clone https://github.com/duman-dp/Goethe.git
cd Goethesudo apt update
sudo apt install ffmpeg# Create virtual environment
python3 -m venv venv
# Activate it
source venv/bin/activate
# Install dependencies
pip install -r requirements.txtpython3 setup.pyThis creates all necessary folders and configuration files automatically.
# Add videos to the videos folder
cp /path/to/your/german_video.mp4 videos/
# Add sentences to sentences.txt
nano sentences.txtpython3 main.pyGoethe/
β
βββ π videos/ β Put your videos here (.mp4, .mkv, .avi)
β βββ german_lesson.mp4
β
βββ π transcripts/ β Speech-to-text results (JSON)
β βββ german_lesson.json
β
βββ π output/ β All generated files
β βββ π mp3/ β Your MP3 library! π΅
β βββ π Ich_habe_keine_Zeit/
β β βββ π΅ Ich_habe_keine_Zeit_001.mp3
β βββ π Wie_geht_es_dir/
β β βββ π΅ Wie_geht_es_dir_002.mp3
β βββ π Das_ist_kein_Problem/
β βββ π΅ Das_ist_kein_Problem_003.mp3
β
βββ π modules/ β Python modules (don't edit unless you know)
β βββ speech_recognition.py
β βββ sentence_matcher.py
β βββ audio_extractor.py
β βββ beautiful_logger.py
β βββ setup.py
β
βββ π config.yaml β Configuration settings
βββ π sentences.txt β Sentences you want to find
βββ π main.py β Main program (run this)
βββ π setup.py β First-time setup
βββ π requirements.txt β Python dependencies
βββ π README.md β This file
Edit config.yaml to customize how Goethe works:
# ============================================
# Goethe Configuration
# ============================================
# Audio Settings
audio:
padding_before: 0.03 # Add 0.03s before each sentence (natural sound)
padding_after: 0.03 # Add 0.03s after each sentence
bitrate: 192 # MP3 quality: 128, 192, 256
# Speech Recognition
speech:
model_size: medium # tiny | small | medium | large (best)
language: German # Language to transcribe
device: cpu # cpu or cuda (GPU)
quiet: true # Less output in terminal
# Sentence Matching
matching:
fuzzy_threshold: 60 # 0-100 (lower = more matches, but less accurate)
# Paths
paths:
videos: ./videos
transcripts: ./transcripts
output: ./output
logs: ./logs| Model | Speed | Accuracy | Memory | Best For |
|---|---|---|---|---|
| tiny | π Fastest | 70% | ~1 GB | Testing, short videos |
| small | β‘ Fast | 85% | ~2 GB | Daily use |
| medium | π’ Medium | 92% | ~5 GB | Better accuracy (recommended) |
| large | π Slow | 95% | ~10 GB | Best quality (if you have RAM) |
# Copy videos to the videos folder
cp /path/to/video.mp4 videos/
# Supported formats:
# .mp4, .mkv, .avi, .movOpen sentences.txt:
nano sentences.txtAdd one sentence per line:
Ich habe keine Zeit.
Wie geht es dir?
Das ist kein Problem.
Guten Morgen!
Hallo, wie heiΓt du?
Ich liebe Deutsch.
Wo ist der Bahnhof?
Ich verstehe nicht.
Kannst du mir helfen?
Was ist das?
Tip: Use shorter sentences for better matches!
python3 main.py# List all MP3 files
ls -R output/mp3/
# Play all MP3s
for f in output/mp3/*/*.mp3; do ffplay -autoexit "$f"; done ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π Goethe - German Sentence Audio Extractor β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π€ Step 1: Speech Recognition β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βΉοΈ Found 1 video(s)
πΉ german_lesson.mp4
βΉοΈ β© Skipping: german_lesson.mp4 (transcript exists)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π Step 2: Sentence Matching β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βΉοΈ Searching for 9 sentences
β
Found 6 matches!
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π Matches Found β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β π 1. Ich habe keine Zeit β
β β±οΈ 2:15 - 2:18 β’ Score: 92% β
β π 2. Wie geht es dir β
β β±οΈ 5:30 - 5:33 β’ Score: 88% β
β π 3. Das ist kein Problem β
β β±οΈ 8:45 - 8:48 β’ Score: 85% β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π΅ Step 3: Audio Extraction β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
Created 6 MP3 files!
π Saved to: output/mp3/
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β π Summary β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β π¬ Videos: 1 β
β π Transcripts: 1 β
β π Matches: 6 β
β π΅ MP3 Files: 6 β
β β±οΈ Total time: 5.2 seconds β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Video Length | tiny model | small model |
|---|---|---|
| 1 minute | ~30 seconds | ~1 minute |
| 5 minutes | ~2 minutes | ~5 minutes |
| 10 minutes | ~4 minutes | ~10 minutes |
First time: Longer (downloads AI model ~1GB)
Yes! Change language: German to:
French,Spanish,Italian,PortugueseEnglish,Chinese,Japanese,Korean- Any language supported by Whisper
- YouTube
- Deutsche Welle
- Easy German
- Your own recordings
- German movies/TV
Normal! Speech recognition uses a lot of CPU. To reduce heat:
- Use
model_size: tiny(fastest, coolest) - Process shorter videos (2-3 minutes)
- Take breaks between processing
- Put laptop on a hard surface for airflow
Try these fixes:
- Lower
fuzzy_thresholdto 50 in config.yaml - Use shorter sentences
- Check if sentences actually appear in your video
- Use simpler sentences first
Yes! Put all videos in the videos/ folder. Goethe will process them all.
sudo apt update
sudo apt install ffmpegsource venv/bin/activate
pip install -r requirements.txt# Run setup to create folders
python3 setup.pyWarning: You are sending unauthenticated requests to the HF Hub
This is normal. To speed up downloads:
- Create free account at: https://huggingface.co/join
- Get token: https://huggingface.co/settings/tokens
- Set token:
export HF_TOKEN="hf_xxxxxxxxxx" - Or just wait - it works without token (slower)
# Use tiny model
# Edit config.yaml and set:
# model_size: tiny# Make sure you're in the right folder
cd ~/Goethe
# Check folder structure
ls -la| Tip | Benefit |
|---|---|
| Use short videos (2-5 min) | Faster processing |
| Use tiny model first | Quick testing |
| Clear audio = better results | Higher accuracy |
| Add simple sentences first | Higher match rate |
| Lower threshold to 50 | More matches |
| Process one video at a time | Less memory usage |
| Close other apps | More CPU for processing |
Here's a full example from start to finish:
# 1. Download a German video (example using yt-dlp)
yt-dlp "https://www.youtube.com/watch?v=example" -o videos/german_lesson.mp4
# 2. Create sentences.txt
cat > sentences.txt << EOF
Ich habe keine Zeit.
Wie geht es dir?
Das ist kein Problem.
Guten Morgen!
Hallo, wie heiΓt du?
Ich liebe Deutsch.
Wo ist der Bahnhof?
Ich verstehe nicht.
Kannst du mir helfen?
Was ist das?
EOF
# 3. Activate environment
source venv/bin/activate
# 4. Run Goethe
python3 main.py
# 5. Find your MP3s
ls output/mp3/
# 6. Listen to them!
ffplay output/mp3/*/*.mp3Want to help improve Goethe?
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
Areas that need help:
- Better documentation
- More language support
- GUI interface
- Batch processing improvements
- Performance optimizations
MIT License β Free to use, modify, and share!
- faster-whisper β Speech recognition
- FFmpeg β Audio extraction
- Hugging Face β Model hosting
- GitHub: @duman-dp
- Project: Goethe
- Issues: Report a bug
If Goethe helped you learn German, please star β this repository!
Happy Learning! π©πͺπ§