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()