From 2c0e330acf1955ca673da3b0be760f86b7b2fa7b Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 7 Oct 2021 20:01:44 +0200 Subject: [PATCH 1/5] sudo apt-get install portaudio19-dev --- .github/workflows/lint_python.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint_python.yml b/.github/workflows/lint_python.yml index d850a6f..3948cff 100644 --- a/.github/workflows/lint_python.yml +++ b/.github/workflows/lint_python.yml @@ -14,7 +14,8 @@ jobs: - run: codespell --ignore-words-list=ans - run: flake8 . --count --max-complexity=19 --max-line-length=88 --show-source --statistics - run: isort --check-only --profile black . - - run: pip install -r requirements.txt || pip install --editable . || true + - run: sudo apt-get install portaudio19-dev + - run: pip install -r requirements.txt - run: mkdir --parents --verbose .mypy_cache - run: mypy --ignore-missing-imports --install-types --non-interactive . - run: pytest . || true From 5cad58d41c389703060cd9d7e1ca7dd45388ee85 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 8 Oct 2021 16:49:18 +0200 Subject: [PATCH 2/5] Add libespeak-dev --- .github/workflows/lint_python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint_python.yml b/.github/workflows/lint_python.yml index 3948cff..3fd89e7 100644 --- a/.github/workflows/lint_python.yml +++ b/.github/workflows/lint_python.yml @@ -14,7 +14,7 @@ jobs: - run: codespell --ignore-words-list=ans - run: flake8 . --count --max-complexity=19 --max-line-length=88 --show-source --statistics - run: isort --check-only --profile black . - - run: sudo apt-get install portaudio19-dev + - run: sudo apt-get install libespeak-dev portaudio19-dev - run: pip install -r requirements.txt - run: mkdir --parents --verbose .mypy_cache - run: mypy --ignore-missing-imports --install-types --non-interactive . From 65a3629aa2acff09ebb5586059c5cd9eae2c1f59 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 8 Oct 2021 17:00:06 +0200 Subject: [PATCH 3/5] Set pyttsx3 driver name using platform.system() --- Jarvis2.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Jarvis2.py b/Jarvis2.py index b37d890..4254dfc 100755 --- a/Jarvis2.py +++ b/Jarvis2.py @@ -3,6 +3,7 @@ import datetime import getpass import os +import platform import random import smtplib import sys @@ -13,9 +14,11 @@ import wikipedia print("Initializing Jarvis....") -MASTER = getpass.getuser() +MASTER = getpass.getuser() or "Harsha" -engine = pyttsx3.init("nsss") +# Set driver name by OS: https://pyttsx3.readthedocs.io/en/latest/engine.html +driver = {"Darwin": "nsss", "Windows": "sapi5"}.get(platform.system(), "espeak") +engine = pyttsx3.init(driver) voices = engine.getProperty("voices") engine.setProperty("voice", voices[0].id) From 0fdfb2b61ea353e261714ab0a59a9b16271bbb0c Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 8 Oct 2021 17:22:22 +0200 Subject: [PATCH 4/5] Take the default driver --- Jarvis2.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Jarvis2.py b/Jarvis2.py index 4254dfc..06e0658 100755 --- a/Jarvis2.py +++ b/Jarvis2.py @@ -3,7 +3,6 @@ import datetime import getpass import os -import platform import random import smtplib import sys @@ -16,9 +15,7 @@ print("Initializing Jarvis....") MASTER = getpass.getuser() or "Harsha" -# Set driver name by OS: https://pyttsx3.readthedocs.io/en/latest/engine.html -driver = {"Darwin": "nsss", "Windows": "sapi5"}.get(platform.system(), "espeak") -engine = pyttsx3.init(driver) +engine = pyttsx3.init() voices = engine.getProperty("voices") engine.setProperty("voice", voices[0].id) From 4c729692c31e93a9b0dd468b03e9f69a02e24d89 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sun, 10 Oct 2021 17:10:12 +0200 Subject: [PATCH 5/5] MASTER --> master --- Jarvis2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jarvis2.py b/Jarvis2.py index ec90bd4..a79865d 100755 --- a/Jarvis2.py +++ b/Jarvis2.py @@ -15,7 +15,7 @@ import gui print("Initializing Jarvis....") -MASTER = getpass.getuser() or "Harsha" +master = getpass.getuser() or "Harsha" engine = pyttsx3.init() voices = engine.getProperty("voices")