Use of sampler in coroutines
Hi,
I understand that formally, coroutines are not supported in OSWeb, though some aspects of them do work. When trying to play an audio file, through a sampler object in a coroutine in OSWeb, I get the following error message: "Uncaught Error: Item audio does not have correct coroutine implementation". Is there a way to solve this? (This works fine in the regular offline mode)
If not, is there any other recommend way to present simultaneously visual and auditory stimuli, while waiting for keyboard response (the visual image should be presented for a short time, followed by a black screen, while user can respond from the begging of the visual image presentation till the end of the black screen).
Thanks,
Galit
Comments
Hi @Galit ,
The
sampleris able to play sound in the background anyway, even withoutcoroutines. You simply need to set the duration to 0. Would that be a solution for your case?Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi Sebastiaan,
Thanks for your reply.
Regarding the solution you offered, do you suggest to play the audio sound in the background and also have a coroutine displaying the visual image for a short time, followed by a black screen while the user can respond through the keyboard whenever he wants? Also without the use of coroutines the audio will be presented simultaneously as the visual image in the coroutine?
Thank you,
Galit
Hi @Galit ,
Exactly! First start the playblack of the sound with a
sampler. Next, move on to thecoroutinesitem for the visual stimuli.Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi Sebastian,
Thanks, this works!
Best,
Galit