7s audio file only plays 1s when running

OS (Win10):
**PsychoPy 3

There are two sound file in my condition file. One is about 1s and the other is about 7s. When I run my program, the 7s sound only play 1s. Hope someone can help me.

Do you have any code to end the Routine which could be ending it prematurely? And have you set the duration on either sound?

I have no code to control the sound.
I set the duration blank because I think the two sound can play integrally.

Yep, keeping duration blank is usually what I’d advise! It could be that it sets the duration of the sound object on creation, but changing the sound doesn’t change the duration… Coud you share the full psyexp file so I can look into this further?

实验大作业.psyexp (17.8 KB)
条件文件.xlsx (9.8 KB)

Thank you very much!

I think I see what’s happening! When you set the sound to update every repeat, it will create a placeholder Sound object whose sound is set to just be a note. When duration is blank, it will play that note for 1s and then loop until the routine ends. However, when the sound is updated to be a file, it retains the duration of 1s but not the looping behaviour. This is a bug which I’ll attempt to fix, in the mean time the best way around this is to add a column to your conditions file with the duration of each sound and then use that duration value for Stop

Hi, TParsons
Thank you for your help.
I have add a column which records the duration of my sound file to my conditions file, but the sounds still play 1 s.

4

A thought hit me. I give up the sound files and use the A sound and its effect is OK to my experiment.

This is a known issue for audio specified in loops:

If your goal is to go online, you should be okay. It doesn’t have the same bug in the javascript verison.

1 Like