psychopy.org | Reference | Downloads | Github

Experiments with Mic as response keep crashing halfway

Hi everyone, I’m relatively new to PsychoPy and haven’t been able to conduct experiments recording students’ oral production. Thanks in advance! Here are the details:
OS ( Win10):
**PsychoPy version2021.1.4
**Standard Standalone
**What are you trying to achieve?
I want to do a delayed picture naming test, giving students pictures and ask them to name the picture upon a cue (beep), but the experiment keep crashing halfway. Other experiments with mic as response (recording) have the same problem. Very occassionally, the experiments run to the end, but more often, they crash halfway. Experiments without a mic element run really smoothly.

**What did you try to make it work?
There is a warning about ptb/pyo as preference. I’ve tried to put ptb as preferred, but it reminds me of pyo not as preferred, but if I put pyo as preferred, it will warn about ptb not as preferred. And I’m not sure whether it’s the reason for the crash, but there is no error alert, just this warning.

What specifically went wrong when you tried that?:
Hello from the pygame community. Contribute - pygame wiki
7.0891 WARNING Starting Microphone but sound lib preference is set to be [‘PTB’, ‘pyo’, ‘sounddevice’, ‘pygame’]. Clashes might occur since ‘pyo’ is not preferred lib but is needed for Microphone

Experiment ended.

9.8508 EXP Imported DelPNPracTotal.xlsx as conditions, 4 conditions, 2 params
9.8561 EXP Imported DelayPNtotal.xlsx as conditions, 4 conditions, 2 params
9.8564 WARNING duplicate variable names: instruction, files
9.8573 INFO Loaded monitor calibration from [‘2021_05_11 09:52’]
9.8986 EXP Imported DelPNPracTotal.xlsx as conditions, 4 conditions, 2 params
9.9042 EXP Imported DelayPNtotal.xlsx as conditions, 4 conditions, 2 params
9.9045 WARNING duplicate variable names: instruction, files

In 2021.2.0 (still hot off the presses - only came out last week!) we made some pretty substantial changes to mic - especially to the back end. It may be worth updating as this bug (along with a lot in mic) may have been fixed.

With any release ending in .0 I advise caution until there’s been a few bug fix releases out (2021.2.1, 2021.2.2, etc.), but I think upgrading would be worth it in your case.

Thanks a lot for the great news! I’ve tried to open my experiments with version 2021.2.0, but it didnot work out well (the timeline doesn’t show on the screen)
I’ve somehow managed to fix the problem under a friend’s help by adding two codes, one for “Begin Experiment”, the other for “End Routine”, as follows:
Begin Experiment
import gc
End Routine:
PicNamPrac_mic.playback(stop=True)
gc.collect()
Most of the time, it works out well, with occasional crash. Hope it can help those who meet the same problem.