Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

How to stop sounds after keypress

edited May 2019 in OpenSesame


In my experiment, the participants will see two pictures and listen to a sentence. They need to choose a matched picture according to the sentence. I used a sampler to display the sound. Howerver, I want the sound to stop and proceed to the next stimulus when a key is pressed. I've tried to set the duration as "keypress" and "0', but they did not work as I expected. Does anyone know how to solve it?


  • Hi,

    I feel a little silly to ask that, but are you sure that setting it to zero didn't work? I don't know see a reason why it shouldn't work.


  • Hi Eduard,

    Yes, I'm sure I've set the duration to "0", but the sound cannot stop. The experiment can go to the next item after selecting the answer, but the sound won't stop. And the sound of previous one will overlap the next one. I don't know why it happens. I've attached an example. Could you please have a look?

    Thanks a lot indeed!!!

  • Hi Niu,

    Sorry for the terribly late reply. There are two things you can do.

    1) Don't use the Sampler plugin, but play the sound directly with Python (but you can still use the functions of the sampler, see

    2) Add another sampler (or synth item) to your loop, in which you play a brief sound for 20 ms or so, but set the volume to 0. That is maybe not a super clean solution but should do the trick.

    Good luck,


Sign In or Register to comment.