Added windows support, OS X support coming soon!

This commit is contained in:
Jeremiah Ticket 2019-12-06 14:20:45 -09:00
parent 56b0b44f66
commit fa02172655
2 changed files with 19 additions and 4 deletions

View File

@ -1,3 +1,8 @@
# libstormgames # libstormgames
Library to make writing audiogames easier. Library to make writing audiogames easier.
## Requirements
configparser pyxdg pygame pyperclip requests
### Only for windows
accessible_output2

View File

@ -18,8 +18,14 @@ try:
import speechd import speechd
spd = speechd.Client() spd = speechd.Client()
speechProvider = "speechd" speechProvider = "speechd"
except: except ImportError:
pass 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 subprocess
import time import time
@ -45,9 +51,13 @@ def speak(text, interupt = True):
if speechProvider == "speechd": if speechProvider == "speechd":
if interupt == True: spd.cancel() if interupt == True: spd.cancel()
spd.say(text) spd.say(text)
else:
if speechProvider == "accessible_output2":
s.speak(text, interrupt=True)
def exit_game(): def exit_game():
spd.close() if speechProvider == "speechd": spd.close()
pygame.mixer.music.stop() pygame.mixer.music.stop()
pygame.quit() pygame.quit()
exit() exit()