Import audio sound - wav file

Hi Anna,
using PsychoPy 1.90.2, I have the same error you posted above when I use loops with wave files:

From cffi callback <function callback_ptr at 0x1E913370>:
Traceback (most recent call last):
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\sounddevice.py”, line 1008, in callback_ptr
return _wrap_callback(callback, data, frames, time, status)
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\sounddevice.py”, line 2773, in _wrap_callback
callback(*args)
File “C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy\sound\backend_sounddevice.py”, line 199, in callback
self.sounds.remove(thisSound)
ValueError: list.remove(x): x not in list

I could fix it with the following steps (source 1 source 2):

  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)

Since it involves changing PsychoPy files, use it with caution. :wink:

Best
Torge