- Python 100%
|
|
||
|---|---|---|
| .gitignore | ||
| cli.py | ||
| config.yaml | ||
| pyproject.toml | ||
| README.md | ||
| scan_media_path.py | ||
| transcribe.py | ||
Audio File Tracker
Scan, transcribe, and play back audio and video media files using faster-whisper word-level timestamps.
Quick Start
-
Create a virtual environment and install dependencies:
uv venv source .venv/bin/activate uv pip install -e . -
Create a
config.yamlin the project root (see the includedconfig.yamlfor all available options). -
Scan your media library into the local SQLite database:
uv run python scan_media_path.py -
Transcribe the audio files:
uv run python transcribe.py -
Play back entries interactively:
uv run python cli.py
Scripts
scan_media_path.py
Walks the directory specified by media_path in the config, registers
each audio/video file in media.db, computes SHA-256 checksums, and
extracts ID3 tags. If watch_media_paths is enabled in the config, it
continues running and watches for new or modified files via inotify.
uv run python scan_media_path.py [-f CONFIG_FILE]
transcribe.py
Loads a faster-whisper model (CUDA with CPU fallback) and transcribes
all untranscribed files in the database. Stores per-word timestamps
(sample offsets and seconds) in the words table. Logs package
versions on startup for reproducibility.
uv run python transcribe.py [-f CONFIG_FILE]
cli.py
Interactive REPL. Type a sentence and it plays back one random audio segment per word from the database. Supports:
-
/random <n>— play n random words -
Up/Down arrow history (persisted to
cli_history_file) -
Configurable pre/post silence gaps and extra tail duration
-
Video file support (extracts audio via ffmpeg)
uv run python cli.py [-f CONFIG_FILE]
Configuration
All runtime behaviour is controlled by config.yaml. Key settings:
| Key | Description |
|---|---|
media_path |
Root directory to scan for media files |
db_path |
SQLite database location |
model |
faster-whisper model name |
device |
cuda or cpu |
language |
Transcription language code |
reprocess_transcribed |
Re-transcribe files already marked done |
watch_media_paths |
Keep running and watch for new files |
skip_checksum |
Skip SHA-256 computation |
cli_output_gap_pre |
Silence before each word (ms) |
cli_output_gap_post |
Silence after each word (ms) |
cli_output_longer |
Extra tail audio per word (ms) |
cli_use_sample_offsets |
Use sample offsets vs. seconds |