Configuration

Everything is set through environment variables. The defaults suit a first try.

VariableDefaultEffect
OPENPRONOUNCE_DEVICEautocpu, cuda, cuda:1, mps
OPENPRONOUNCE_TTSgttsVoice of the synthetic reference reading: gtts (network on the first analysis of a sentence), piper or kokoro (offline)
OPENPRONOUNCE_TTS_VOICEper engineVoice id, such as en_GB-cori-medium or af_heart
OPENPRONOUNCE_MODELS_DIRnoneFolders searched for model files before the shipped ones: add a language or replace a model
OPENPRONOUNCE_G2Pper languagelexicon (English, CMU dictionary) or espeak
OPENPRONOUNCE_ESPEAKespeak-ngPath of the espeak-ng program
OPENPRONOUNCE_PHONEME_MODELonoff skips the sound recognizer; word errors then come from the transcription, less precise
OPENPRONOUNCE_CACHE_DIRsystem tempWhere synthetic references are cached
HF_HOME~/.cache/huggingfaceWhere the speech models live
HF_HUB_OFFLINEunset1 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.