bci-workshop icon indicating copy to clipboard operation
bci-workshop copied to clipboard

Fix sound in exercise 2 on Mac

Open jdpigeon opened this issue 7 years ago • 6 comments

Bleeps are not bleeping correctly

jdpigeon avatar Jan 13 '18 17:01 jdpigeon

maybe we should look into python libraries like this? https://pypi.python.org/pypi/playsound/1.2.1

micuat avatar Jan 14 '18 02:01 micuat

ok I tested playsound on windows 10 and osx 10.10.5 (both python 3.6). windows worked out of the box, but osx didn't, I needed to install pyobjc separately (https://github.com/TaylorSMarks/playsound/issues/5)

micuat avatar Jan 15 '18 22:01 micuat

To avoid installing extra libraries, is it possible to call (from Python) piece of software already existent in OSX to play sounds? Similar to the approach followed in the Windows version?

rcassani avatar Jan 15 '18 22:01 rcassani

@rcassani I understand your point but the problem is that the current exercise script tried to do it and it is not working right now. I think we should add a dependency so we don't have to solve cross platform sound related issue again...

micuat avatar Jan 21 '18 23:01 micuat

It looks like if we used a requirements file we could throw conditional logic after a semicolon in a python requirements file to only install packages on certain platforms.

Something like: playsound; sys_platform == 'darwin'

Either that or we could just make a note in the instructions for MAC users to install playsound. I'm leaning towards a seperate requirements file

jdpigeon avatar Jan 23 '18 15:01 jdpigeon

@jdpigeon great idea, actually I was thinking about packaging bci-workshop as a pip package so you only need to pip install bci-workshop to install dependencies. In my opinion we're already using lsl and other 3rd party libraries, so adding playsound won't be a problem.

micuat avatar Jan 23 '18 15:01 micuat