sound
Hi,
I have designed an experiment very similar to the 'cats, dogs and capybaras' example.
In my experiment, people will hear a sound and have to decide whether it is a male or a female by clicking on a corresponding picture. In the sampler file I have set the duration to 0, so the sound is presented at the same time as the pictures.
Some of the sounds are quite long and participants might indicate their answer before the sound has finished playing. This is fine but I would like the sound to stop once once people have indicated their answer (i.e. clicked on the male or female picture in the sketchpad). Is this possible?
Many thanks,
Maria
Comments
The sample has a function
"sampler.stop()"
which stops the sound, if you build this command into a while loop that checks for keypresses/mouseclicks you can execute it as soon as a response is detected, see the attached opensesame example.
see also:
http://osdoc.cogsci.nl/3.1/manual/python/sampler/
good luck
PS: for the mouse response its something like:
button, position, timestamp = my_mouse.get_click(timeout=20)
instead of the 'keyb.getkey()', see:
http://osdoc.cogsci.nl/3.1/manual/python/mouse/