Added windows support, OS X support coming soon!
This commit is contained in:
parent
56b0b44f66
commit
fa02172655
@ -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
|
||||||
|
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user