psychopy.org | Reference | Downloads | Github

Can the OS affect the ability to edit the Audio library?

This is for v1.90.2, running on Mac OS

I need participants to change the preferences to the following:

audio library: [u’pygame’, u’pyo’, ]
audio driver: [u’portaudio’, ]

(Incidentally, does the audioDevice make a difference? I seem to have switched mine from auto to Built-in Output at some point…)

One participant has updated these preferences and the experiment has worked fine for them. However, another participant tried to do exactly the same thing and psychopy wouldn’t let him make the changes. He gets a message back saying:

Invalid value in “audio library” (“General”

Then when he goes back to the preferences window, everything has changed to:

Audio library: [u’[’, u’u’, u"’", u’p’, u’y’, u’g’, u’a’, u’m’, u’e’, u’,’, u’u’, u"’", u’p’, u’y’, u’o’, u"’", u’,’, u’ ‘, u’]’, ]

Audio driver: [u’ coreaudio’, u’portaudio’,]

if you look at this Audio library entry carefully, it says “u’pygame’, u’pyo’,” but with loads of 'u’s etc in it…

Any thoughts on what could be happening, and why it’s happening to him rather than to the other participant? This participant has a much more recent OS, so perhaps that has something to do with it?

In Python, typing something in ' marks tells Python that it’s a string (text), adding a u in front of the ' tells it that it is specifically a unicode string. What seems to be happening is that it’s interpreting the entire statement (brackets and all) as a string of unicode characters. Two things you could try:

  1. Add a ‘$’ before the whole thing, which tells Psychopy that what follows is a command to be executed, not just a string
  2. Replace the ' with ", which is a subtly different kind of string which Python may simply interpret better.

I also notice you’re using quite an old version of Psychopy, it could be that your participant has a newer version. Try updating your version, as Psychopy3 uses Python3 which may be dealing with strings differently.