make sound nonblocking
This commit is contained in:
parent
8a3ead822a
commit
4aee07b34c
@ -8,7 +8,6 @@ class command():
|
|||||||
if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'sound', 'enabled'):
|
if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'sound', 'enabled'):
|
||||||
environment['runtime']['outputManager'].presentText(environment, "sound disabled",soundIconName='SoundOff', interrupt=True)
|
environment['runtime']['outputManager'].presentText(environment, "sound disabled",soundIconName='SoundOff', interrupt=True)
|
||||||
environment = environment['runtime']['settingsManager'].setSetting(environment, 'sound', 'enabled', str(not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'sound', 'enabled')))
|
environment = environment['runtime']['settingsManager'].setSetting(environment, 'sound', 'enabled', str(not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'sound', 'enabled')))
|
||||||
print(not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'sound', 'enabled'))
|
|
||||||
if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'sound', 'enabled'):
|
if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'sound', 'enabled'):
|
||||||
environment['runtime']['outputManager'].presentText(environment, "sound enabled",soundIconName='SoundOn', interrupt=True)
|
environment['runtime']['outputManager'].presentText(environment, "sound enabled",soundIconName='SoundOn', interrupt=True)
|
||||||
return environment
|
return environment
|
||||||
|
@ -7,7 +7,7 @@ class sound():
|
|||||||
def playFrequence(self, frequence, duration, adjustVolume):
|
def playFrequence(self, frequence, duration, adjustVolume):
|
||||||
pass
|
pass
|
||||||
def playSoundFile(self, filePath, interrupt = True):
|
def playSoundFile(self, filePath, interrupt = True):
|
||||||
subprocess.call("play -q " + filePath, shell=True)
|
self.proc = subprocess.Popen("play -q " + filePath, shell=True)
|
||||||
def cancel(self):
|
def cancel(self):
|
||||||
pass
|
pass
|
||||||
def setCallback(self, callback):
|
def setCallback(self, callback):
|
||||||
|
Loading…
Reference in New Issue
Block a user