Skip to content

Commit 2cc0da4

Browse files
committed
Sound bugfixing
1 parent 42f18e3 commit 2cc0da4

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

obci/gui/ugm/blinking/ugm_modal_blinking_engine.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from obci.gui.ugm import ugm_engine
1616
from PyQt4 import QtCore
1717
import time
18-
18+
import os.path
1919

2020
class UgmModalBlinkingEngine(UgmBlinkingEngine):
2121
"""A class representing ugm application. It is supposed to fire ugm,
@@ -59,10 +59,17 @@ def __init__(self, p_config_manager, p_connection,
5959

6060
def _init_auditory(self, configs):
6161
soundfiles = configs.get_param('soundfiles').split(';')
62-
self.audio_server = pyo.Server()
62+
self.context['logger'].info(str(soundfiles))
63+
self.audio_server = pyo.Server(audio='pa')
6364
self.audio_server.boot()
65+
while not self.audio_server.getIsBooted():
66+
time.sleep(1)
67+
self.context['logger'].info('audio server bootup'+str(self.audio_server.getIsBooted()))
6468
self.audio_server.start()
65-
sounds = [pyo.SfPlayer(f) for f in soundfiles]
69+
while not self.audio_server.getIsStarted():
70+
time.sleep(1)
71+
self.context['logger'].info('soundfiles: {}'.format(soundfiles))
72+
sounds = [pyo.SfPlayer(os.path.expanduser(f)) for f in soundfiles]
6673
assert len(soundfiles) == len(self._active_ids)
6774
assert len(sounds) == len(self._active_ids)
6875
self._sounds = dict(zip(self._active_ids, sounds))
@@ -128,5 +135,5 @@ def _unblink(self):
128135

129136

130137
if __name__ == '__main__':
131-
ugm_engine.run()
138+
ugm_engine.run()
132139

0 commit comments

Comments
 (0)