Error when trying to use microphone. PTB-ERROR

Hi everyone!

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): v2022.2.5
Standard Standalone? (y/n) : y
What are you trying to achieve?: My participant will see a word on screen and have to pronounce it.

What did you try to make it work?: I have two task with the microphone. Everything worked well, I added the second task with the same parameter as the first microphone response, and now I cannot launch my experiment. I’ve tried to use another audio library. I use the correct audiodevice and my microphone responses also. I don’t know what’s going wrong? If I disable the second microphone component, then everything goes well. It has exactly the same settings as the first mic.

Does anyone has an idea how to fix this?
Thank you for your time and help.

image

What specifically went wrong when you tried that?:

Running: C:\Users\Oriane\Documents\Oriane\Etudes\UU\Thesis\PsychoPy\test_lastrun.py

97.5497 INFO Loaded monitor calibration from [‘2023_01_12 14:13’]
pygame 2.1.0 (SDL 2.0.16, Python 3.8.10)
Hello from the pygame community. Contribute - pygame wiki
PTB-ERROR: Failed to open audio device 9. PortAudio reports this error: Invalid device
Traceback (most recent call last):
PTB-ERROR: Desired audio parameters likely unsupported by audio device.
PTB-ERROR: This could be, e.g., due to an unsupported combination of audio sample rate, audio channel count/allocation, or audio sample format.
Error in function Open: Usage error
Failed to open PortAudio audio device due to unsupported combination of audio parameters.
PsychPortAudio:Open: Usage:

pahandle = PsychPortAudio(‘Open’ [, deviceid][, mode][, reqlatencyclass][, freq][, channels][, buffersize][, suggestedLatency][, selectchannels][, specialFlags=0]);
12.3748 WARNING launchHubServer: If using the iohub mouse or eyetracker devices, fullScr should be True.
1.2869 WARNING Monitor specification not found. Creating a temporary one…
File “C:\Users\Oriane\Documents\Oriane\Etudes\UU\Thesis\PsychoPy\test_lastrun.py”, line 273, in
mic_2 = sound.microphone.Microphone(
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\sound\microphone.py”, line 478, in init
self._stream = audio.Stream(
File “C:\Program Files\PsychoPy\lib\site-packages\psychtoolbox\audio.py”, line 97, in init
self.handle = PsychPortAudio(‘Open’, device_id, mode,
Exception: Failed to open PortAudio audio device due to unsupported combination of audio parameters.
Exception ignored in: <function Stream.del at 0x000001CC01BA39D0>
Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\psychtoolbox\audio.py”, line 236, in del
self.close()
File “C:\Program Files\PsychoPy\lib\site-packages\psychtoolbox\audio.py”, line 146, in close
raise err
File “C:\Program Files\PsychoPy\lib\site-packages\psychtoolbox\audio.py”, line 139, in close
PsychPortAudio(‘Close’, self.handle)
AttributeError: ‘Stream’ object has no attribute ‘handle’
################# Experiment ended with exit code 1 [pid:6428] #################