psychopy.org | Reference | Downloads | Github

Trouble getting 3 sounds play at certain routines each. SoundFormatError

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): PsychoPy 2021.1.2
Standard Standalone? (y/n) yes
What are you trying to achieve?:
I am trying to create a digit span task, where the participants will see sequences of numbers, then have 20sec after each sequence to answer typing numbers with background music as a distractor. I need different pieces of music at trials 7-14, 15-21, then a different piece for trials 22-28

What did you try to make it work?:

I used this solution adding routines with a sound component and a code component on the spots at the flow where I wanted the sound stimuli to start, and a code copmponent to the consecutive routines following (where I wanted the sound to be, for instance to routines 14-21) as is said to the solution I linked above.

What specifically went wrong when you tried that?:
The experiment can’t be ran. However, it worked when I only had one sound.
The message is:
psychopy.exceptions.SoundFormatError: Tried to create audio stream 48000_2_128 but 44100_2_128 already exists and win32 doesn’t support multiple portaudio streams

Experiment ended.

I’m posting the whole traceback too:
Traceback (most recent call last):
File “C:\Users\User\Desktop\ΤΕΛΙΚΑ ΑΡΧΕΙΑ\EXPERIMENT_COMPL_lastrun.py”, line 772, in
name=‘vocalfeeling’)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_sounddevice.py”, line 318, in init
hamming=self.hamming)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_sounddevice.py”, line 373, in setSound
raise err
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_sounddevice.py”, line 365, in setSound
blockSize=self.blockSize)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_sounddevice.py”, line 96, in getStream
blockSize=blockSize)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\sound\backend_sounddevice.py”, line 135, in _getStream
.format(label, list(self.keys())[0], sys.platform)
psychopy.exceptions.SoundFormatError: Tried to create audio stream 48000_2_128 but 44100_2_128 already exists and win32 doesn’t support multiple portaudio streams

Experiment ended.

Could somebody please help me figure this out? Many thanks in advance!

All of your sounds need to have the same bit rate. You can edit this in Audacity.

1 Like

Thank you for the response! I’ve been trying this by the “save as” option, however in a .wav format there is no such option. Perhaps I’m doing something wrong. I’ll keep trying! Thanks again!

Try Tracks - Resample

1 Like

I fixed it by changing the Hz, choosing the same number for every track. Thank you so much!

1 Like