Offline speech-to-text and translation in Python, using Whistle (Cactus Compute's 16.9 MB on-device speech model) and Argos Translate.
Languages: English, German, French, Spanish, Italian, Dutch, Polish.
uv venv venv && uv pip install --python venv/bin/python -r pyproject.tomlWhistle's weights and each Argos language pack download once on first use; after that everything runs offline.
venv/bin/python main.py file test.wav --timestamps # transcribe a WAV file
venv/bin/python main.py file test_de.wav --to en # transcribe, then translate
venv/bin/python main.py mic --seconds 5 --to fr # record from the mic
venv/bin/python main.py live --to pl # live; translates on Ctrl+COther options: --language forces the spoken language, --keywords biases recognition toward given phrases.
test_ar.wavis an Arabic sample. Whistle does not support Arabic, so it produces a wrong transcript.- Translation between two non-English languages pivots through English.
cactus-needletelemetry is turned off by default inmain.py(NEEDLE_TELEMETRY=0).