music not stopped after keypress
in OpenSesame
Hi
i try to play music with the sampler until the user click on keyboard, for that i configure in the samplaer the duration "keypress" and after that i add keyboard response, even the experiment continue to the next skechpad the music continue playing, how i can stop the music in the sampler after key press??
Comments
Hi,
I think they solved the problem in this thread by putting a Python inline_script after the keyboard_response. I'm not sure if you have to set the duration of the sampler to 0 though, or leave it as "keypress".
https://forum.cogsci.nl/discussion/6429/is-it-possible-to-stop-sound-played-by-sampler-at-keypress
Hi @amer6 ,
I think the "duration" parameter apples to the duration of the object, not that of the sound being played. To stop the sound you can indeed use Python code to force the sampler to stop the sound (thanks @sflu for your entry!).
Remember to keep the sampler duration to keypress and place the Pyhton code after the sampler. The result is that on a key press, the sampler will stop, move on to the Python code and the latter will stop the sound. Here's an example (in OS version 4):
Best,
Fabrice.
thank you