the first beep i.e BEEP 1 works perfectly fine but for some reason the second beep i.e BEEP 2 doesn’t work and I can’t seem to figure out why. Is there some process related to sound.play() that I’m missing out?
I removed the unnecessary parts from my code.
Also I don’t understand what you’re asking me, I clearly used the sound module from psychopy but the second audio cue just doesn’t work.
The latest one I suppose, just installed it a week ago. I also solved the issue but don’t know why it’s responding that way, can you try to explain it to me?
After each play(), I added core.wait(2.0) followed by beep.stop() and this worked. But if I put beep.stop() before core.wait(2.0) l it didn’t work.
Any idea why this is happening?
Oh I see, yes. That’s just because you stopped the sound too fast, or because in the original code you posted above your script ended (which also stops the sound) before you had time to hear anything.
If you aren’t very confident with programming I’d really strongly recomend you use the Builder interface. Actually I’d recommend that for most people even if they are competent programmers! I almost never hand-write the code for my experiments. Using Builder would have avoided simple errors like this.
Thanks for the help and I’ll take your suggestion to account.
But I found something that contradicts your reasoning as shown in the description below:
When I did the below it worked fine - any wait time(core.wait()) works and I tried up to 100 ms.
From the above, I don’t think this issue has anything to do about the sound being too fast or the program ending. To confirm this I also reduced the duration of the beep to as low as 0.03s and the same thing happend as stated for the above two scripts.
From this I can say that this is probably happening because the play() doesn’t get reset once the sound is over hence stop() needs to be explicitly defined for the sound to reset. If the stop() isn’t defined then once the sound is over it doesn’t get reset hence when beep.play() is done the second time I hear nothing. Do you think my reasoning makes sense?
That’s conceivable and would probably depend on the sound lib being used, as mentioned above, but I’m surprised this isn’t causing lots of problems for others if true. Anyway, glad you got a fix.