Soundfiles presented randomly, duration cut off

Hello,

OS (e.g. Win10): MacOS High Sierra (10.13.6)
PsychoPy version (e.g. 1.84.x): PsychoPy3 v2020.1.2
Standard Standalone? (y/n) : Y
What are you trying to achieve?: In the exposure phase of this experiment, I want to present a number of soundfiles (of variable durations) in a random order to participants who must memorize them. The first soundfile is generally presented in its entire duration, however subsequent soundfiles seem to be cut off if they are of longer duration than the first (reference) soundfile. E.g., if soundfile1 = 3.5s and soundfile2= 4.5s, I hear the first 3.5s of sounfile2 but not the last 1s of it.

What did you try to make it work? and what specifically went wrong when you tried that?:

  1. I have tried to force a fixed duration in the sound property object, e.g. Stop duration 5 (s) (since all the sound files are under 5s). That didn’t solve the issue: the soundfiles of longer duration than the first presented were still cut off.

  2. I have tried switching the libraries in Parameter>Audio from sounddevice to ptb. It lets me run the experiment when I switch to ptb however the sound pitch is systematically distorted (higher pitch than original) and crackling noise is introduced throughout all soundfiles.

  3. I have tried switching to pyo, but it did not let me run it, and gave me this error message:

0.8167 WARNING pyo audio lib was requested but not loaded: ImportError(‘dlopen(/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/lib-dynload/pyo/_pyo.so, 2): Library not loaded: @loader_path/libportaudio.2.dylib\n Referenced from: /Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/lib-dynload/pyo/_pyo.so\n Reason: image not found’,)

  1. I have tried switching to pygame, i was able to run it but only the first soundfile played, the other soundfiles never played, so I exited and it showed this error:

8.0155 WARNING Hamming was requested using the ‘pygame’ sound library but hamming is not supported there.

edit: 5) I have also tried a technique I saw in this forum consisting of adding a ISI (static screen) but I have the same issue as before when I run the experiment i.e., the soundfiles are cut off.

I would be fine with sounddevice or even pygame as for my experiment latency is not too important. A solution would be to use sounddevice and prerandomize the soundfiles in the spreadsheet and present them sequentially, with the first soundfile being the longest of all so that the subsequent will not be cut off. But I was really hoping to be able to randomize the stimuli. Also, I cannot help but think that surely this must be possible within PsychoPy?(I am a complete beginner). I am just puzzled with what to do next and would appreciate any help. Thanks so much for reading and any input.

1 Like