Sound distorted

59 views
Skip to first unread message

Anneke Haddad

unread,
Jan 12, 2016, 10:15:16 AM1/12/16
to psychopy-users
I'm using Coder view, Psychopy 1.83.03 in OSX.

My experiment uses an audio stimulus which is a scream sound. This plays in Psychopy, but it doesn't sound like a scream. Instead it sounds rather like a sort of jittery beep - as if it's perhaps just looping the first msec? The scream plays fine in VLC and also plays fine within the experiment when I run it on my office machine (also OS X and 1.83.03) rather than the lab machine. It also plays fine when inserted randomly into one of the Builder demos.

Interestingly, when I try the soundStimuli demo in the coder, I sometimes (but not always) get weird distortions too. This demo also sometimes causes Psychopy to crash with the error "Fatal Python error: (pygame parachute) Segmentation Fault." I don't know if this crash behaviour is related to my issue or something specific to the soundStimuli demo though. The demo runs fine on my office machine (no distortions and no crashing).

Also interestingly, we have had a similar problem of a distorted scream when transferring this audio file to a Windows laptop (different experiment but same stimulus file), which I still haven't been able to resolve.

The file is in .wav format with sampling rate of 44.100kHz.

Does anyone have any ideas as to what could be causing this issue? 


Michael MacAskill

unread,
Jan 13, 2016, 5:26:55 PM1/13/16
to psychop...@googlegroups.com
Hi Anneke,

It sounds like you are using pygame for sound instead of the more reliable pyo library. In the preferences, set the audio library field to be:

['pyo','pygame']

So that pyo is used in preference to pygame.

Don't know if that will solve your problem, but is a good place to start.

Regards,

Michael
--
Michael R. MacAskill, PhD 66 Stewart St
Research Director, Christchurch 8011
New Zealand Brain Research Institute NEW ZEALAND

Senior Research Fellow, michael....@nzbri.org
Te Whare Wānanga o Otāgo, Otautahi Ph: +64 3 3786 072
University of Otago, Christchurch http://www.nzbri.org/macaskill

Jonathan Peirce

unread,
Jan 14, 2016, 9:10:39 AM1/14/16
to psychop...@googlegroups.com
For completeness, this turned out to be caused by Anneke's script
calling the sound.play() on every frame and the sound kept trying to
play from the beginning.

Jon

On 13/01/16 22:26, Michael MacAskill wrote:
> Hi Anneke,
>
> It sounds like you are using pygame for sound instead of the more reliable pyo library. In the preferences, set the audio library field to be:
>
> ['pyo','pygame']
>
> So that pyo is used in preference to pygame.
>
> Don't know if that will solve your problem, but is a good place to start.
>
> Regards,
>
> Michael
>
>
>> On 13/01/2016, at 04:15, Anneke Haddad <anneke...@gmail.com> wrote:
>>
>> I'm using Coder view, Psychopy 1.83.03 in OSX.
>>
>> My experiment uses an audio stimulus which is a scream sound. This plays in Psychopy, but it doesn't sound like a scream. Instead it sounds rather like a sort of jittery beep - as if it's perhaps just looping the first msec? The scream plays fine in VLC and also plays fine within the experiment when I run it on my office machine (also OS X and 1.83.03) rather than the lab machine. It also plays fine when inserted randomly into one of the Builder demos.
>>
>> Interestingly, when I try the soundStimuli demo in the coder, I sometimes (but not always) get weird distortions too. This demo also sometimes causes Psychopy to crash with the error "Fatal Python error: (pygame parachute) Segmentation Fault." I don't know if this crash behaviour is related to my issue or something specific to the soundStimuli demo though. The demo runs fine on my office machine (no distortions and no crashing).
>>
>> Also interestingly, we have had a similar problem of a distorted scream when transferring this audio file to a Windows laptop (different experiment but same stimulus file), which I still haven't been able to resolve.
>>
>> The file is in .wav format with sampling rate of 44.100kHz.
>>
>> Does anyone have any ideas as to what could be causing this issue?

--
Jonathan Peirce
University of Nottingham

http://www.peirce.org.uk





This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please send it back to me, and immediately delete it.

Please do not use, copy or disclose the information contained in this
message or in any attachment. Any views or opinions expressed by the
author of this email do not necessarily reflect the views of the
University of Nottingham.

This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system, you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation.

Reply all
Reply to author
Forward
0 new messages