Switching from Piper TTS to OpenAI TTS

Trying to modify “/home/pidog/pidog/examples/20_voice_active_dog_gpt.py”

from

TTS_MODEL = "en_US-ryan-low"

to

TTS_MODEL = "gpt-4o-mini-tts"

but getting this error:

Traceback (most recent call last):
File “/usr/lib/python3.13/runpy.py”, line 198, in _run_module_as_main
return _run_code(code, main_globals, None,
“main”, mod_spec)
File “/usr/lib/python3.13/runpy.py”, line 88, in _run_code
exec(code, run_globals)
~~~~^^^^^^^^^^^^^^^^^^^
File “/home/pidog/.vscode-server/extensions/ms-python.debugpy-2025.18.0-linux-arm64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/main.py”, line 71, in 
cli.main()
~~~~~~~~^^
File “/home/pidog/.vscode-server/extensions/ms-python.debugpy-2025.18.0-linux-arm64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py”, line 508, in main
run()
~~~^^
File “/home/pidog/.vscode-server/extensions/ms-python.debugpy-2025.18.0-linux-arm64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py”, line 358, in run_file
runpy.run_path(target, run_name=“main”)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/pidog/.vscode-server/extensions/ms-python.debugpy-2025.18.0-linux-arm64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py”, line 310, in run_path
return _run_module_code(code, init_globals, run_name, pkg_name=pkg_name, script_name=fname)
File “/home/pidog/.vscode-server/extensions/ms-python.debugpy-2025.18.0-linux-arm64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py”, line 127, in _run_module_code
_run_code(code, mod_globals, init_globals, mod_name, mod_spec, pkg_name, script_name)
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/pidog/.vscode-server/extensions/ms-python.debugpy-2025.18.0-linux-arm64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py”, line 118, in _run_code
exec(code, run_globals)
~~~~^^^^^^^^^^^^^^^^^^^
File “/home/pidog/pidog/examples/20_voice_active_dog_gpt.py”, line 95, in 
vad = VoiceActiveDog(
llm,
…<12 lines>…
instructions=INSTRUCTIONS,
)
File “/home/pidog/pidog/examples/voice_active_dog.py”, line 102, in init
super().init(*args, **kwargs)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.13/dist-packages/sunfounder_voice_assistant/voice_assistant.py”, line 85, in init
self.tts = TTS(model=tts_model)
~~~^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.13/dist-packages/sunfounder_voice_assistant/tts/piper.py”, line 34, in init
self.set_model(model)
~~~~~~~~~~~~~~^^^^^^^
File “/usr/local/lib/python3.13/dist-packages/sunfounder_voice_assistant/tts/piper.py”, line 230, in set_model
raise ValueError(“Model not found”)
ValueError: Model not found



What are we missing?

en_US-ryan-low is an offline tts engine, i.e it’s already been downloaded locally onto your rpi. Other valid choices would be e.g en_US-amy-low. It’s small and runs easily on an rpi.

gpt-4o-mini-tts is a powerful online ai engine, so the error message stating that it cannot be found is correct, its not available locally on your computer. It’s online only.