Audio file doesn't stop after keypress
I want participants in my experiment to listen to a long-ish audio file so they can adjust the audio volume to a comfortable level. I would like the file to stop playing once they hit a key, and then have them move on to the experiment. I tried setting the duration of the sampler to keypress, but that didn't work as expected, the file continued to play. Is there another way to achieve this or a better way of allowing them to test and adjust the volume? I can't use Python as I'm planning to run the experiment online.
Thanks in advance!