Microphone Related Problem

OS: Windows 10
PsychoPy version: v2022.2.2

Hello everyone. I’m trying to build an experiment(a verbal fluency task) that records the verbal responses of participants in 4 trials, for 60 seconds in each trial. The problem is, the experiment crashes before starting& I keep getting errors when I add the microphone to the experiment, but the experiment works fine when all microphone components are removed.

And an interesting observation, when I add only 1 microphone I can run the experiment for only the first trial(which is the one that includes the microphone), but when that trial ends, the experiment crashes & I get a somewhat different error.I tried playing with the properties of microphone component, such as sample rate(Hz), max recording size, etc., but none of them worked.

I’ve added the both errors(1 microphone & 4 microphones) below. Any help would be appreciated. Thank you.

This is the error I get when I run the experiment with only 1 microphone component added.:

Running: C:\Users\asus\Desktop\2022-Summer\Without Microphone\VFluencyTask_NoMic_lastrun.py

1333.9173 INFO Loaded monitor calibration from [‘2022_06_21 13:51’]
pygame 2.1.0 (SDL 2.0.16, Python 3.8.10)
Traceback (most recent call last):
Hello from the pygame community. Contribute - pygame wiki
6.8636 WARNING User requested fullscreen with size [1024 768], but screen is actually [1920, 1080]. Using actual size
8.2469 WARNING t of last frame was 21.05ms (=1/47)
1.2825 WARNING Monitor specification not found. Creating a temporary one…
File “C:\Users\asus\Desktop\2022-Summer\Without Microphone\VFluencyTask_NoMic_lastrun.py”, line 914, in
mic_1.stop()
File “C:\Users\asus\AppData\Local\Programs\PsychoPy2\lib\site-packages\psychopy\sound\microphone.py”, line 802, in stop
raise AudioStreamError(
psychopy.sound.exceptions.AudioStreamError: Cannot stop a stream that has not been started.
################# Experiment ended with exit code 1 [pid:7020] #################
1420.4695 INFO Loaded monitor calibration from [‘2022_06_21 13:51’]

This is the error I get when I run the experiment with multiple microphone components(1/trial, 4 in total):

Running: C:\Users\asus\Desktop\2022-Summer\New Experiment\VFluencyTask_v2_lastrun.py

1062.8789 INFO Loaded monitor calibration from [‘2022_06_21 13:51’]
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 5. 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]);
8.2155 WARNING User requested fullscreen with size [1024 768], but screen is actually [1920, 1080]. Using actual size
File “C:\Users\asus\Desktop\2022-Summer\New Experiment\VFluencyTask_v2_lastrun.py”, line 240, in
mic_2 = sound.microphone.Microphone(
File “C:\Users\asus\AppData\Local\Programs\PsychoPy2\lib\site-packages\psychopy\sound\microphone.py”, line 478, in init
self._stream = audio.Stream(
File “C:\Users\asus\AppData\Local\Programs\PsychoPy2\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 0x000001896F58B0D0>
Traceback (most recent call last):
File “C:\Users\asus\AppData\Local\Programs\PsychoPy2\lib\site-packages\psychtoolbox\audio.py”, line 236, in del
self.close()
File “C:\Users\asus\AppData\Local\Programs\PsychoPy2\lib\site-packages\psychtoolbox\audio.py”, line 146, in close
raise err
File “C:\Users\asus\AppData\Local\Programs\PsychoPy2\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:1156] #################
1081.5526 INFO Loaded monitor calibration from [‘2022_06_21 13:51’]