Can't Present Sound Stimuli and Text Stimuli Simultaneously in Pavlovia (Unspecified JS Error)

URL of experiment: https://gitlab.pavlovia.org/ocingiler/psy329_dichoticlistening_oc
https://pavlovia.org/ocingiler/psy329_dichoticlistening_oc

You can pass first screens by pressing SPACE after waiting 5 seconds per screen and then pressing 1 for the auditory stimuli.

Description of the problem: I have a dichotic listening task that works on my computer in Python that I built in Builder. At the beginning of the task the participant is presented with a headphone check, which consists of sound stimuli and text stimuli and it works perfectly Participant starts the headphone check and presses 1,2 or 3 on the keyboard and finishes the check and then the Demo part of my experiment begins, where I want to present sound stimuli to participants and want them to press F or K based on the parity of the number they hear. The problem is, I can’t present the text and the sound in the same routine (Even in the routine afterwards), I can either present sound or text. When I try to present sound and text in the same routine I get Unspecified Javascript Error, I tried using images instead of text, I tried using text boxes, I tried even video, but none of them worked. Every time I try, I get the same error: Unspecified Javascript Error. Only thing that works is polygons, I can present polygons while playing sounds, but anything else breaks the experiment. The experiment file is “snarc_exp_With_Separated_Keyboard_Component_BAK”.

One can say that I have too many psyexp files in the folder and that’s why I can’t run the experiment. Yet, I tried recreating the experiment from scratch, and still when I try to present the sound files I have in a loop with a text, I get the same problem. The interesting thing is, the headphone check works perfectly, which basically does the same thing: Present sound files with text component.

By the way: I also tried changing units, it didn’t work. I tried setting text not as constant but as changing every repeat. I tried setting the units to height and making the texts height 1 -to not have decimal sizes-, which is non-sensical as it would fill the whole screen, and it didn’t work either. I tried changing sound files’ names from “F-1-B.wav” to “F_1_B.wav” to see if it was the problem with the minus sign instead of an underscore, but it also didn’t work. I tried deleting code component too, it was also ineffective. Also, if I recall correctly I had a problem with presenting text in the next routine in the loop, after showing sound with no text, it again gave Unspecified Javascript Error.

If anyone could help I would be more than grateful.

Thanks

Okay, there was one thing I didn’t try: I tried inputting the headphoneCheck conditions Excel file to the demo, and it works, apparently there is a problem with my conditions files (or with the sounds themselves). If you could help me find the problem I would be really really thankful.

I have 6 conditions files, 4 for experiment ( conditions_DLKF,conditions_DLFK,conditions_SKF and conditions_SFK) and 2 for demo( demo_DL, demo_S). For some reason, getting the files doesn’t work exactly as I intended and causes an error.

I have just tried using constant file input to sound component (instead of getting them from a list in an excel file), it didn’t work too. Could the problem be that my sound files are 0.6 seconds long? Do they have to have integer length?

I think it’s gone down due to holidays, so renewing the topic again: Does anyone know a solution? It would be really great if anyone knew. I basically cannot present some sound stimuli with other stimuli, but can present other sounds perfectly.

I think that you need to leave the duration field of sound components blank for online.

Sounds should either be edited to correct length or use sound.stop() in a code component.
https://docs.google.com/document/d/13jp0QAqQeFlYSjeZS0fDInvgaDzBXjGQNe4VNKbbNHQ/edit?usp=sharing

Thank you for your answer!

I tried doing this but it didn’t work, am I doing something wrong?

I don’t know if .getDuration works and if you just leave the duration blank if you want the sound to play to the end.

How about:

if t > .5:
     sound_5.stop()
     continueRoutine=False

if you want the sound and routine to finish after .5 seconds.

Thank you for your help! I tried it (and several variations of it) but unfortunately it doesn’t work.