speak sentences using random words transcribed from your audio/video collection.
Find a file
phero f25da16b89 docs: add README with quick start, script docs, and config reference
Co-authored-by: aider (ollama/qwen3.8:27b) <aider@aider.chat>
2026-11-01 20:53:19 +01:00
.gitignore initial commit 2026-11-01 20:36:09 +01:00
cli.py initial commit 2026-11-01 20:36:09 +01:00
config.yaml initial commit 2026-11-01 20:36:09 +01:00
pyproject.toml initial commit 2026-11-01 20:36:09 +01:00
README.md docs: add README with quick start, script docs, and config reference 2026-11-01 20:53:19 +01:00
scan_media_path.py initial commit 2026-11-01 20:36:09 +01:00
transcribe.py initial commit 2026-11-01 20:36:09 +01:00

Audio File Tracker

Scan, transcribe, and play back audio and video media files using faster-whisper word-level timestamps.

Quick Start

  1. Create a virtual environment and install dependencies:

    uv venv
    source .venv/bin/activate
    uv pip install -e .
    
  2. Create a config.yaml in the project root (see the included config.yaml for all available options).

  3. Scan your media library into the local SQLite database:

    uv run python scan_media_path.py
    
  4. Transcribe the audio files:

    uv run python transcribe.py
    
  5. 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