psychopy.org | Reference | Downloads | Github

Problem with Psychopy2 Coder: Sound is not played

Hi there!
I have an problem with psychopy2 on win(64), standalone version.

I would love to use Psychopy3, this would solve all my problems. xD
But i have to stick with Psychopy2 because the eyetracking system is just compatible with Psychopy2.

The experiment is already programmed, the only thing missing is the relax part with sound and pictures.
If i try using “sound.Sound” i get this error (this is also what i get if i run the demo under “Demos”):
UnicodeDecodeError: ‘utf8’ codec can’t decode byte 0xf6 in position 20: invalid start byte

Is there anybody with a sugestion?
That would help me so much!
Best & stay healthy
Laura

-------------------------------------------------------------------

Relaxationpart

-------------------------------------------------------------------

#relaximages
p4 = [‘p1.png’,‘p2.png’,‘p3.png’,‘p4.png’,‘p5.png’,‘p6.png’,‘p7.png’,‘p8.png’,‘p9.png’,
‘p10.png’,‘p11.png’,‘p12.png’,‘p13.png’,‘p14.png’,‘p15.png’,‘p16.png’,‘p17.png’,
‘p18.png’,‘p19.png’,‘p20.png’,‘p21.png’,‘p22.png’,‘p23.png’,‘p24.png’]

music = sound.Sound(‘music.wav’)

music.play()

while playlist[i].status == PLAYING:
endExpNow = False
for thisTrial in p4:
imageX=visual.ImageStim(win,image=thisTrial, pos=(0,0), size=(1920,1080), units=‘pix’)
imageX.draw()
win.flip()
core.wait(1)#test: 7

   win.flip()

And I already tried some fixes like that one:

  1. Get admin rights
  2. Open C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy\sound\backend_sounddevice.py
  3. Go to line 199
  4. Remove “.sounds” from self.sounds.remove(thisSound)

Unfortunally that didn’t work for me either…

Hello,
i still have the same problem.
Is there anybody with a suggestion i could try?
Best Laura

Hi Laura, you really need to provide the full text of the error message so we can see where it arises from. i.e. we need to know if the error is arising from your own code, or is buried deep inside psychoPy itself.

But given that you are using a potentially quite old version of PsychoPy, I wonder if you are running into this old issue:

Hi Michael,
thank you for your response!
This is the whole error message, just the line of my code is displayed.
I already tried this solution but it thows a “hardware item not found error”.
I will probably, if possible, go with a woraround.
thank you!
laura