From fa02172655e01abc829688baf08ee344bcd3ebdb Mon Sep 17 00:00:00 2001 From: Jeremiah Ticket Date: Fri, 6 Dec 2019 14:20:45 -0900 Subject: [PATCH] Added windows support, OS X support coming soon! --- README.md | 7 ++++++- libstormgames.py | 16 +++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 79972d0..ea0c62a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ # libstormgames -Library to make writing audiogames easier. \ No newline at end of file +Library to make writing audiogames easier. + +## Requirements +configparser pyxdg pygame pyperclip requests +### Only for windows +accessible_output2 diff --git a/libstormgames.py b/libstormgames.py index e3967ca..be53504 100755 --- a/libstormgames.py +++ b/libstormgames.py @@ -18,8 +18,14 @@ try: import speechd spd = speechd.Client() speechProvider = "speechd" -except: - pass +except ImportError: + import accessible_output2.outputs.auto + s = accessible_output2.outputs.auto.Auto() + speechProvider = "accessible_output2" +except ImportError: + print("No other speech providers found.") + exit() + import subprocess import time @@ -45,9 +51,13 @@ def speak(text, interupt = True): if speechProvider == "speechd": if interupt == True: spd.cancel() spd.say(text) + else: + if speechProvider == "accessible_output2": + s.speak(text, interrupt=True) + def exit_game(): - spd.close() + if speechProvider == "speechd": spd.close() pygame.mixer.music.stop() pygame.quit() exit()