NeuroTechX / bci-workshop

Material for the BCI Workshop held at District 3 in May 2015 by BCI Montréal.
Other
88 stars 54 forks source link

Fix sound in exercise 2 on Mac #13

Open jdpigeon opened 6 years ago

jdpigeon commented 6 years ago

Bleeps are not bleeping correctly

micuat commented 6 years ago

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

micuat commented 6 years ago

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)

rcassani commented 6 years ago

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?

micuat commented 6 years ago

@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...

jdpigeon commented 6 years ago

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

micuat commented 6 years ago

@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.