SoundStream Error

I am in the final steps of writing my experiment. I have had this one error that I haven’t been able to fix.

This is the error I am getting:

Running: C:\Users\nylah\InfantAttentionStudy\infant_attention_v3_lastrun.py

5621.9777 INFO Loaded monitor calibration from [‘2025_03_11 15:19’]
5622.0083 INFO Loaded monitor calibration from [‘2025_03_11 15:19’]
Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\sound\backend_ptb.py”, line 626, in stream
label, s = streams.getStream(sampleRate=self.sampleRate,
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\sound\backend_ptb.py”, line 141, in getStream
return self._getStream(sampleRate,
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\sound\backend_ptb.py”, line 180, in _getStream
raise SoundFormatError(
psychopy.exceptions.SoundFormatError: Tried to create audio stream 44100_1_128 but 48000_1_128 already exists and win32 doesn’t support multiple portaudio streams

I have one routine that serves as an attention getter, this uses some audio that I downloaded online.

I then have another routine that uses sounds that I am pulling from a conditions file. For this routine, I am creating the sound component within code, pulling the sound from my conditions file and then cycling between a sequence of sounds.

The error mentions that I have two audio streams at two different hertz but I have checked and checked over again and all the sound files that I am using in both routines are at the same hertz and have the same number of channels. This makes me believe that PsychoPy is creating some “soundstream” somewhere but I am not sure where and how to look for it? Has anybody had this issue before?

This is my first time posting on here, I’m not sure if it was smart to just paste all my code here but please let me know what I should be looking at/what I should paste here to figure this out.

Thank you in advance for your help

Try disabling the audio in the attention getter, to see if it is different from the main sounds.

From version 2025.1.0, this error should be dealt with by changing the bit rate to match the output device dynamically.

Thank you for your response. So when I disable the attention getter, the experiment does run smoothly. Interestingly, even when I put one of the sounds from my other routine (one of the sounds from my condition file) into the attention getter routine, the experiment still crashes with that same error. How would I go about changing the bit rate to match?