Configuration
Everything is set through environment variables. The defaults suit a first try.
| Variable | Default | Effect |
|---|---|---|
OPENPRONOUNCE_DEVICE | auto | cpu, cuda, cuda:1, mps |
OPENPRONOUNCE_TTS | gtts | Voice of the synthetic reference reading: gtts (network on the first analysis of a sentence), piper or kokoro (offline) |
OPENPRONOUNCE_TTS_VOICE | per engine | Voice id, such as en_GB-cori-medium or af_heart |
OPENPRONOUNCE_MODELS_DIR | none | Folders searched for model files before the shipped ones: add a language or replace a model |
OPENPRONOUNCE_G2P | per language | lexicon (English, CMU dictionary) or espeak |
OPENPRONOUNCE_ESPEAK | espeak-ng | Path of the espeak-ng program |
OPENPRONOUNCE_PHONEME_MODEL | on | off skips the sound recognizer; word errors then come from the transcription, less precise |
OPENPRONOUNCE_CACHE_DIR | system temp | Where synthetic references are cached |
HF_HOME | ~/.cache/huggingface | Where the speech models live |
HF_HUB_OFFLINE | unset | 1 once the models are there: nothing is fetched any more |
Fully offline
Two things reach the network by default: the model download on the first run, and the text of the expected sentence sent to Google's speech synthesis the first time that sentence is analysed. The audio is never sent. To cut both:
$ pip install "openpronounce[tts-piper]" $ export OPENPRONOUNCE_TTS=piper HF_HUB_OFFLINE=1
Run once with the network to fetch the models and the voice, then unplug it. --fast or acoustic=False skip the synthetic reading altogether.