0

I am trying to change the preferences of audiolib from Pyo to Pygame in Psychopy but it does not seem to work.

from psychopy import prefs, sound
prefs.general['audioLib'] = ['pygame']
.
.
.
sound1 = sound.Sound('name.wav')
sound1.play()

It keeps showing:

pyo version 0.8.0 (uses single precision)

The sound is alright but I want to use Pygame instead. Can anyone tell me what I am doing wrong? Thanks!

TYL
  • 1,577
  • 20
  • 33

1 Answers1

2

Import sound after changing the preferences.

# Set preferences first
from psychopy import prefs
prefs.general['audioLib'] = ['pygame']

# Now load the psychopy modules that you want, using the preferences above
from psychopy import sound
Jonas Lindeløv
  • 5,442
  • 6
  • 31
  • 54