psychopy.org | Reference | Downloads | Github

Missing sound libraries for PsychoPy3 standalone release 3.2.3 for Win32

We just switched from Psychopy 2 to PsychoPy 3 ( PsychoPy3_PY2 3.2.3 package for Win32) for the low audio latency but we cannot run our script at all at the moment.

Originally we were calling pygame with this code:

from psychopy import visual, core, event, monitors, tools, prefs
prefs.general['audioLib'] = ['pygame']
from psychopy import sound

We changed this code to

from psychopy import visual, core, event, monitors, tools, prefs prefs.hardware['audioLib'] = ['PTB']
from psychopy import sound

but now I am getting the following message

"C:\Users\Display\AppData\Local\Programs\Python\Python36\lib\site-packages\psychopy-3.2.3-py3.6.egg\psychopy\sound\__init__.py", line 99, in <module>
    .format(prefs.hardware['audioLib']))
psychopy.exceptions.DependencyError: No sound libs could be loaded. Tried: ['sounddevice', 'PTB', 'pyo', 'pygame']
Check whether the necessary sound libs are installed
3.7736  WARNING         sounddevice audio lib was requested but not loaded: sounddevice not working
3.7762  WARNING         PTB audio lib was requested but not loaded: psychtoolbox audio failed to import
3.7787  WARNING         pyo audio lib was requested but not loaded: ModuleNotFoundError("No module named 'pyo'",)
3.7810  WARNING         pygame audio lib was requested but not loaded: ModuleNotFoundError("No module named 'pygame'",)

How do I install each module? Or should I download another version of PsychoPy?

Hi.

Right now I had the same problem.

My environment: Linux Mint 19.2, python 3.7.4, Psychopy 3.2.3

  1. I installed psychtoolbox 3.0.16, but error not gone anywhere.
  2. I installed pygame 1.9.6 and now Psychopy is working.

So, you can try pygame.

Hi @Vitali, did you follow the instructions on the website for installing PsychToolBox on a Linux machine?

No :slight_smile:

I did not see this instruction. I installed and compiled portaudio and then installed PsychToolBox via pip

Ok, well if you have a 64 bit machine, try those instructions (downloading relevant dependencies) and then try the pip install psychtoolbox.

But I successfully installed psychtoolbox before, based on this portaudio. Now I checked, that libusb-1.0-0-dev and libasound2-dev already exists in my system, so I did not catch error during pip install psychtoolbox.
But after that when I tried run PsychoPy i still had error. After installed pygame, error disappeared.

Ok thanks for the info @Vitali . Just checking you can actually use PsychToolBox now. There must be an issue with installing Pygame from the dependencies list.

Hi Vitali and dvbridges,

Unfortunately I cannot use pygame. I am programming for a VWP experiment where I present audio files along with the videos and pictures. It is very important for me to minimize the latency and right now with pygame I have random latencies in the range of 30-100 ms.

We tried using ptb backend but for that we had to install Python 3.7 and unfortunately our pylink module - a proprietor module developed by SR people to connect to Eye Link 1000 plus the eye-tracker that we use in the lab) - only works with python 3.4 I saw an alternative solution to pylink was another module iohub but it was not tested on Eye Link 1000 plus.

So we decided to hold off from switching to ptb and get at least pyo to play but we have Windows and as of right now I cannot get pro to play through the psychopy script.

I have installed pyo but when I run the test scripts to play a few test sounds through pyo the files do not play. I can hear the .wav recordings when I click on the files individually not through a python script.

pygame 1.9.4
Hello from the pygame community. https://www.pygame.org/contribute.html
[u’Primary Sound’, u’ASIO’, u’Audigy’]
psychopy.prefs <C:\Users\Display\AppData\Roaming\psychopy2\userPrefs.cfg>:
prefs.general[‘winType’] = u’pyglet’
prefs.general[‘units’] = u’norm’
prefs.general[‘fullscr’] = False
prefs.general[‘allowGUI’] = True
prefs.general[‘version’] = u’’
prefs.general[‘paths’] = []
prefs.general[‘audioLib’] = [‘pyo’]
prefs.general[‘audioDriver’] = [‘ASIO’]
prefs.general[‘audioDevice’] = [u’default’]
prefs.general[‘flac’] = u’’
prefs.general[‘parallelPorts’] = [u’0x0378’, u’0x03BC’]
prefs.general[‘shutdownKey’] = u’’
prefs.general[‘shutdownKeyModifiers’] = []
prefs.coder[‘readonly’] = False
prefs.coder[‘codeFont’] = u’Lucida Console’
prefs.coder[‘commentFont’] = u’Lucida Console’
prefs.coder[‘outputFont’] = u’Lucida Console’
prefs.coder[‘codeFontSize’] = 10
prefs.coder[‘outputFontSize’] = 10
prefs.coder[‘showSourceAsst’] = False
prefs.coder[‘showOutput’] = True
prefs.coder[‘reloadPrevFiles’] = True
prefs.coder[‘preferredShell’] = u’pyshell’
prefs.coder[‘newlineConvention’] = u’keep’
prefs.builder[‘reloadPrevExp’] = False
prefs.builder[‘unclutteredNamespace’] = False
prefs.builder[‘componentsFolders’] = [u’/Users/Shared/PsychoPy2/components’]
prefs.builder[‘hiddenComponents’] = [u’PatchComponent’]
prefs.builder[‘unpackedDemosDir’] = u’’
prefs.builder[‘savedDataFolder’] = u’data’
prefs.builder[‘topFlow’] = False
prefs.builder[‘alwaysShowReadme’] = True
prefs.builder[‘maxFavorites’] = 10
prefs.connections[‘proxy’] = u’’
prefs.connections[‘autoProxy’] = True
prefs.connections[‘allowUsageStats’] = True
prefs.connections[‘checkForUpdates’] = True
prefs.connections[‘timeout’] = 20.0

initializing pyo
1.9563 INFO sound is using audioLib: pyo
1.9813 INFO Looking for ASIO
1.9813 INFO Examining for Microsoft Sound Mapper - Output
1.9813 INFO Examining for Speakers (Sound Blaster Audigy
1.9813 INFO Examining for Realtek Digital Output (Realtek
1.9813 INFO Examining for SPDIF Out (Sound Blaster Audigy
1.9813 INFO Examining for Primary Sound Driver
1.9813 INFO Examining for Speakers (Sound Blaster Audigy 5/Rx)
1.9813 INFO Examining for Realtek Digital Output (Realtek High Definition Audio)
1.9813 INFO Examining for SPDIF Out (Sound Blaster Audigy 5/Rx)
1.9814 INFO Examining for ASIO4ALL v2
1.9814 INFO Success: ASIO4ALL v2
1.9814 INFO Using sound driver: ASIO4ALL v2 (ID=16)
2.0140 INFO Looking for ASIO
2.0140 INFO Examining for Microsoft Sound Mapper - Input
2.0140 INFO Examining for Line-In (Sound Blaster Audigy 5
2.0140 INFO Examining for Microphone (Sound Blaster Audig
2.0140 INFO Examining for “What U Hear” (Sound Blaster Au
2.0141 INFO Examining for Primary Sound Capture Driver
2.0141 INFO Examining for Line-In (Sound Blaster Audigy 5/Rx)
2.0141 INFO Examining for Microphone (Sound Blaster Audigy 5/Rx)
2.0141 INFO Examining for “What U Hear” (Sound Blaster Audigy 5/Rx)
2.0141 INFO Examining for ASIO4ALL v2
2.0141 INFO Success: ASIO4ALL v2
2.0141 INFO Using sound-input driver: ASIO4ALL v2 (ID=16)
2.0465 WARNING psychopy.sound.backend_pyo.init could not find microphone hardware; recording not available
2.7097 EXP Set sound=C
2.7097 DEBUG pyo sound server started
Using pyo(with None) for sounds
y for bleep, n for buzz, i for tick, o for tock, q for quit

We cannot hear any of the audio. We can hear them from the individual sound files.

Any suggestions on what to check for and how to get the ASIO connect with pyo?

Thanks,
Ana