You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to psychop...@googlegroups.com
Hey all - I'm trying to play audio files that are sampled at 16KHz, but it seems that Psychopy is playing them at a faster rate than it should. I can't seem to find a way to change the sampling rate in the builder, and I'm pretty new to this software so I'm unsure of how to do this with code. Can anyone point me in the right direction?
Thanks!
Michael MacAskill
unread,
Jun 23, 2013, 9:39:51 PM6/23/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
> The problem seems to be with the sample rate: your hello+world.wav clip is 16 000 Hz. After using Audacity to set it to 22050 Hz, it plays fine. So the sound library being used by PsychoPy doesn't deal well with that sample rate. The default rate is 44100 Hz but when I tried to set the optional parameter to 16 000 Hz, no sound played at all.
>
> I'll have to hand over to the sound library experts on this one, but it seems that you might be able to work around the problem in the interim by using Audacity or an equivalent program to change the sample rate of your files to, say, 22050 Hz.
But also PsychoPy now has the option to use an alternative underlying sound library, which may deal with your sound files better. So before editing the files, check PsychoPys settings and switch the order of the audio lib field from:
[u'pygame', u'pyo']
to:
[ u'pyo', u'pygame']
band see if that makes a difference.
Regards,
Michael
Chris Holdgraf
unread,
Jul 4, 2013, 3:11:33 PM7/4/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to psychop...@googlegroups.com
Thanks for the information! It seems that changing the audio libraries is possible with an older version of psychopy, but this option is removed on the latest release. Is this true for you as well?
Michael MacAskill
unread,
Jul 4, 2013, 5:11:39 PM7/4/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
> Thanks for the information! It seems that changing the audio libraries is possible with an older version of psychopy, but this option is removed on the latest release. Is this true for you as well?
That option is still there for me in the latest public release (version 1.77.00 for OS X)…
PsychoPy menu -> Preferences -> General -> audioLib
Mike
Chris Holdgraf
unread,
Sep 17, 2013, 3:40:10 PM9/17/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to psychop...@googlegroups.com
Whoops - upon further inspection I realized that the 'pyo' library fixes the sampling rate problem, but now audio only plays out of one speaker. Is there a way to either fix the single-speaker problem in 'pyo', or the sampling rate problem in 'pygame'?
Gary Lupyan
unread,
Oct 15, 2013, 12:45:45 AM10/15/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to psychop...@googlegroups.com
Hi Chris, as a temporary fix, you can convert the sounds you are
trying to play to stereo by duplicating the channel. They will then
play from both speakers.
-----------------------------------------------------
Gary Lupyan - lup...@wisc.edu Assistant Professor of Psychology
University of Wisconsin, Madison
http://sapir.psych.wisc.edu -----------------------------------------------------