| Reference | Downloads | Github

Psychopy3: beeps instead of audio

I’m running a preference judgement test where pariticpants listen to a stream of audio, then listen to sound files composed of 2 words and lasting between 2-3 seconds, and press either ‘1’ for if they remember hearing the first word, or ‘2’ for if they remember hearing the second word.
The familiarisation sound file plays fine (it lasts just under 2 minutes), but when I go to the test phase, rather than an audio file with two words I get a beep. No error message appears. I can skip through the different stimuli by pressing 1 or 2 getting a beep each time, so everything is working fine just not the audio.
I have the all the audio files set up as a loop over one trial using an excel file; all audio files are named correctly and are in .wav format.

In addition to this, at the end of my experiment i get a note saying: user requested full screen with size [1536 864] but screen size is actually [1920 1080]. Using actual size.
Could that have anything to do with the audio being affected?

I’ve seen on other posts, that this was an issue with some older versions of psychopy, but since I am using the latest version I’m not sure how to fix this.

I hope I’ve provided enough information to get an explanation of/ solution to the problem, but I would be happy to share more if need be.

Hope to hear back soon, thanks!

Which version is that?

I have a suspicion this bug exists in the latest stable version (1.90.3) but has been corrected in the beta:

I’m using 3.0.0b11

OK, so probably isn’t due to that bug then. Can you show us a screenshot of your sound component?

No, this won’t affect anything sound-related, but should be addressed. You need to add a definition in the Monitor Centre (accessible from PsychoPy’s toolbar) that matches the actual characteristics of your display (physical and pixel dimensions plus distance). Then specify in the experiment settings to use the monitor with that name.

Here’s a screenshot of my sound component. I just noticed the A in the sound part, so I tried changing it to a path of the file where my sound clips are saved, but this came up with error messages.

So the program is doing exactly what you told it to :wink:

You need to replace the A note with the name of the column in your conditions file that contains your sound file names, preceded by a $ symbol to indicate that you are using a variable name rather than a literal value.

You also need to set that field to update on every routine, rather than be constant.

Help us to help you. Please show us your error messages. They are remarkably informative.

Okay thanks for that! I’ve followed your instructions and now the audio clips work until about halfway through where I get this error message:

I noticed I’m still getting the error message about screen size too, even though I have added a monitor with the correct dimensions and specified using that monitor in experiment settings. Maybe I’ve not included something I should have though? (You can probably tell I’m new to this).

Hi @TorgeMS, this self.sounds.remove() bug that you seem to have posted a workaround for several times keeps popping up.

I’m not really familiar with it. Any chance that you might suggest the fix as a pull request at ? That would perhaps squash it once and for all.

Hi @Michael,
yes, it would be great if the bug could be fixed once and for all. However, I just passed on the solution @jon once posted here and don’t know its implications. Since @jon didn’t make a pull request then, I assumed that there was a reason for that line and always warned people that changing it might have unexpected consequences.

OK, this obviously came at a time I was working on other things and I never implemented the fix. Is done now in master and will be int he next release

1 Like

Okay so should I change the self.sounds.remove( ) to self.remove( )? The error says it’s in line 206, but I cannot find it there and I’m not sure If I should add it in? I’ve checked through all ~500 rows and can’t find self.sounds.remove( ) though I may just have missed it. (I have no experience with code so any help would be appreciated).

Hi Rebekah,
the line is not in your experiment file, but in the file indicated in the error message, which is “C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\sound\”. Just go to line 206 or use the search function (Ctrl+F) to find self.sounds.remove() there. You will need administrator rights to save it.

How do I get administrator rights? I’ve tried changing it with a few programs (CLAN, Word, Notepad) but it does not let me save. Is there a specific program I should use?

You need the administrator password (the one you need whenever you want to install a program) because you want to change a protected program file. If you don’t know the password, ask the person responsible for the computer you’re using.
Then open any text editor (Editor, Notepad,…) with admin rights by right-clicking on the shortcut (e.g., in the Windows start menu or on the desktop) and choosing “Run as administrator”. Type in the password, open the file, change it and save it. Restart PsychoPy and your experiment should work.

That’s the experiment working now, thank you all so much!

Just one final thing then you’ll be rid of me (I promise). I’m still having trouble setting the screen parameters and I wonder if I have done everything right?

I’m glad it helped. Concerning the screen parameters, we can’t know if they’re right because we don’t know your hardware and what you want to achieve. You might want to read the very helpful documentation about the monitor center and different units. If you follow the instructions there, you should be fine. If you still have questions, you could start a new topic in the forum.

Just one additional note: in the screenshot you posted of your experiment settings, it is in the “screen” tab (which we can’t see) where you specify the name of the monitor settings you’ve defined.