Added windows support, OS X support coming soon!
This commit is contained in:
parent
56b0b44f66
commit
fa02172655
@ -1,3 +1,8 @@
|
||||
# libstormgames
|
||||
|
||||
Library to make writing audiogames easier.
|
||||
|
||||
## Requirements
|
||||
configparser pyxdg pygame pyperclip requests
|
||||
### Only for windows
|
||||
accessible_output2
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user