From 4aee07b34c93640b9b9cb2ac59d9525c686f4ee0 Mon Sep 17 00:00:00 2001 From: Chrys Date: Wed, 3 Aug 2016 03:00:39 +0200 Subject: [PATCH] make sound nonblocking --- src/fenrir-package/commands/commands/toggle_sound_enable.py | 1 - src/fenrir-package/sound/sox.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/fenrir-package/commands/commands/toggle_sound_enable.py b/src/fenrir-package/commands/commands/toggle_sound_enable.py index 458cd1e4..f0da2dc1 100644 --- a/src/fenrir-package/commands/commands/toggle_sound_enable.py +++ b/src/fenrir-package/commands/commands/toggle_sound_enable.py @@ -8,7 +8,6 @@ class command(): if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'sound', 'enabled'): 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'))) - print(not 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) return environment diff --git a/src/fenrir-package/sound/sox.py b/src/fenrir-package/sound/sox.py index 3e7b7fb2..3a3eca5f 100644 --- a/src/fenrir-package/sound/sox.py +++ b/src/fenrir-package/sound/sox.py @@ -7,7 +7,7 @@ class sound(): def playFrequence(self, frequence, duration, adjustVolume): pass 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): pass def setCallback(self, callback):