Skip to content

About

Offline speech-to-text and translation in Python with Cactus Whistle and Argos Translate

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

whistle-cactus-example

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.

Setup

uv venv venv && uv pip install --python venv/bin/python -r pyproject.toml

Whistle's weights and each Argos language pack download once on first use; after that everything runs offline.

Usage

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+C

Other options: --language forces the spoken language, --keywords biases recognition toward given phrases.

Notes

  • test_ar.wav is an Arabic sample. Whistle does not support Arabic, so it produces a wrong transcript.
  • Translation between two non-English languages pivots through English.
  • cactus-needle telemetry is turned off by default in main.py (NEEDLE_TELEMETRY=0).

About

Offline speech-to-text and translation in Python with Cactus Whistle and Argos Translate

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages