Changing audioLib with prefs does not work

I would say that you are not successfully changing to “pyo” and you are still using the sounddevice audiolib. With this library you are encoutering the same problem as I do, reported here -> Sounddevice and sound presentation

My solution to change the preferences is the following:

Restart python kernel.

import psychopy
psychopy.prefs.general[‘audioLib’] = [‘pygame’] # or any other Audiolib. (I dont have pyo) installed in my system)
from psychopy import sound
standard = sound.Sound(630, sampleRate=44100, secs=0.5, stereo=True )
standard # you can verify that the audiolib has changed

standard.play() # play the tone as many times as need it (at least this works in pygame, I havent tested this in pyo and it does not work with the sounddevice)

Hope this helped.

alex