From 80982b5953c221ab25b4cd3f0cd1cd935261774f Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sat, 26 Sep 2026 07:31:21 +0200 Subject: Use the system kokoro-onnx package, drop the venv kokoro-onnx is now packaged (python3-kokoro-onnx, without espeakng-loader) and finds the system espeak-ng with its default config, so the explicit EspeakConfig and the .venv setup go away. Tested live: two Italian questions answered and spoken correctly. Co-Authored-By: Claude Opus 5.5 --- assistant.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'assistant.py') diff --git a/assistant.py b/assistant.py index 49fb082..00c1081 100644 --- a/assistant.py +++ b/assistant.py @@ -17,7 +17,7 @@ """Mic button on: record. Mic button off: transcribe (whisper-server), ask the loaded llama-server model, speak the reply (Kokoro). -Run: .venv/bin/python assistant.py (--test runs the self-check) +Run: python3 assistant.py (--test runs the self-check) """ import ctypes @@ -134,12 +134,8 @@ def ask(messages): def speaker(q): - from kokoro_onnx import Kokoro, EspeakConfig - # The espeakng-loader wheel's bundled lib has a broken data path; use - # the system espeak-ng. - k = Kokoro(f"{MODELS}/kokoro/kokoro-v1.0.onnx", f"{MODELS}/kokoro/voices-v1.0.bin", - espeak_config=EspeakConfig(lib_path="/usr/lib64/libespeak-ng.so.1", - data_path="/usr/share/espeak-ng-data")) + from kokoro_onnx import Kokoro + k = Kokoro(f"{MODELS}/kokoro/kokoro-v1.0.onnx", f"{MODELS}/kokoro/voices-v1.0.bin") voices = {"it": 0.8 * k.get_voice_style("if_sara") + 0.2 * k.get_voice_style("af_bella"), "en": k.get_voice_style("af_heart")} play = None -- cgit v1.2.3