diff --git a/.gitignore b/.gitignore index 2fb9370..2ca38e3 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ dist/ .env .idea/ .DS_Store +python/.venv/ diff --git a/electron/wakeword.js b/electron/wakeword.js index 731df3d..6436f87 100644 --- a/electron/wakeword.js +++ b/electron/wakeword.js @@ -13,8 +13,9 @@ function startWakeword({ onWake }, retries = 0) { running = true; const scriptPath = path.join(__dirname, '../python/wakeword.py'); + const pythonPath = path.join(__dirname, '../python/.venv/bin/python3'); - const proc = spawn('python3', [scriptPath], { + const proc = spawn(pythonPath, [scriptPath], { stdio: ['pipe', 'pipe', 'pipe'], }); wakewordProcess = proc; diff --git a/python/wakeword.py b/python/wakeword.py index b23c10d..6e1f2ef 100644 --- a/python/wakeword.py +++ b/python/wakeword.py @@ -9,7 +9,12 @@ RATE = 16000 THRESHOLD = 0.5 def main(): - model = Model(wakeword_models=["hey_jarvis"]) + import openwakeword + openwakeword.utils.download_models(["hey_jarvis"]) + model = Model( + wakeword_models=["hey_jarvis"], + inference_framework="onnx" + ) pa = pyaudio.PyAudio() stream = pa.open(