psychopy.org | Reference | Downloads | Github

Experiment not ending, may be related to sound

My psychopy picture naming experiment that has a sound component to indicate the onset of pictures at each trial is not ending properly. I have to manually exit the experiment by pressing the red cross button. Without the sound component, it ends automatically. Why is the one with sound not ending? Is there a fix for this? I have attached the builder files for experiments with and without sound. [I would have uploaded the sound and picture/image files that go with them but I can only upload two items as a new user.]
Thanks.
rial_no_sound.psyexp (11.4 KB) rial.psyexp (12.4 KB)

I am using Psychopy version 3.1.5.

Hi There,

Does it work if you use a different sound file? I ran this with sound as ‘A’ and it ended OK. I am running 2020.2.4

Thanks,
Becca

Hmm, yes I did try different sound files but it still didn’t work. Here are the sound files that I have been using.
Thanks for your quick response.

tone2a.wav (4.21 KB)

tone2.wav (11 KB)

Hey,

Thanks for sharing those - I just gave it another go with those and it seemed OK for me - is it possible for you to update your psychopy version? could be that we are running different versions.

Becca

Yes, it could be that. I will get a newer version and hopefully that will fix it.
Thank you for giving it another go.

No problem. Let us know how you get on
Becca

Thanks Becca. I installed the new version but now I have get the following errors:
Pyo error: Pyo built without Coreaudio support
Pyo error: Server not booted.

Hi There,

OK are you running mac? what happens if you change the sound library of your experiment (in your .psyexp file go experiment settings> auido>audilobrary and try selecting another library - perhaps sound device or pygame - selection of library may be important but it is good to test)

Thanks,
Becca

Yes running on mac. It works with sound device.

And I should also mention that my experiment ended properly. So it was a version related issue after all.

That is great to hear this sounds like a step towards a solution - did the experiment end properly before changing sound libraries or only afterwards?

Thanks,
Becca

Well, before changing sound libraries, the program did not run. It gave the pyo error. The only way it works to completion is after changing the sound library to sound device; it does not work with pygame either.

Ok interesting. I think this might be relating to an issue with the pyo sound library on mac (just so you know, I am running windows and your task is all good on my end). It might be that using another sound library is totally fine for what you want - but I would recommend having a read of the docs on the sound libraries before deciding this work around is fine for your needs :slight_smile: https://www.psychopy.org/api/sound.html

Another strange issue is that the results/output .csv file saves as the last image name file - so let’s say the last picture it displayed was of a tomato and the filename for the image is tomato1a then the .csv file gets saved as tomato1a.csv. The log file gets saved like it should with participant id and session id, in the data folder.

Thanks! Ok, I will take a look at the sound library docs.

Whoa! OK that sounds like a slightly diff issue but a curious one indeed! double check the data filename field in your experiment settings>data and check it isnt $lastImage or whatever you have - that will be where to fix that one :slight_smile:

So pyo on mac worked for the older Psychopy version, although with problems like not ending the experiment. But Pyo on mac with the new version gave the error right away.

Sorry I forgot to message you earlier.

This is what it was set to:
u’data/%s_%s_%s’ % (expInfo[‘participant’], expName, expInfo[‘date’])

I changed
thisExp.saveAsWideText(filename+’.csv’)
thisExp.saveAsPickle(filename)

to
thisExp.saveAsWideText(thisExp.dataFileName+’.csv’, delim=’,’)
thisExp.saveAsPickle(thisExp.dataFileName)

in the coder view and it is now saving the file with the correct name.

Thanks for your help. I believe the new version and changing the sound library fixed the original problem.

1 Like