Can't record speech onset with mic component

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): latest 2021.2.3
Standard Standalone? (y/n) Y
What are you trying to achieve?: I am compiling a picture-naming task. I would like to record speech onset with the built-in option in the microphone component.

What did you try to make it work?:
I inserted a mic component into my routine and switched on the feature Speaking start/stop Times

What specifically went wrong when you tried that?:
I have all sorts of issues with making the microphone component work for me. A summary:

1. I can only obtain clean voice recordings by setting Audio latency priority to 1. With higher priority settings I get distorted audio files.

2. The microphone component works without complaining only if I set the duration to match the duration of the routine. If I set it shorter the experiment crashes after the first trial and I get the following error:

File "D:\PsichoPy_projects\Pic_naming_task\picture_naming_lastrun.py", line 409, in <module>
    mic.stop()
  File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\sound\microphone.py", line 803, in stop
    "Cannot stop a stream that has not been started.")
psychopy.sound.exceptions.AudioStreamError: Cannot stop a stream that has not been started.

3. Despite all the adjustments and having tried different combinations of settings (audio library, latency mode, driver) I can only output the audio clip recordings and the mic.started times. I cannot produce the speech onset times. The output csv file doesn’t even generate the dedicated column, I only get mic.clip, mic.started, mic.stopped.

Does anybody spot what might be the issue? I’ve run out of ideas.

@MattF Did you figure out a solution for this? I’m also curious how to get the speech start and stop times. The same thing happens for me in that the only output I get is the overall Mic start and stop time

1 Like

Sorry for replying late. I did not find any solution. I’ve been working on it so much. Tried every sound parameter combination, different versions of psychopy; I even tried switching from standalone version to the pip-installed one. No results.

I don’t even care anymore about recording speech onset. I just wish I could get clean precise recordings. I can only get clean audio using the sounddevice library with latency 1; I get nothing setting it to 2,3,4. The other libraries, including ptb, just produce some weird crackly and slowed-down recordings.

Also, the task breaks randomly giving the “I can’t stop a stream that has not been started error. I’m avoiding that by commenting out the first of the two mic.stop() in the script.

Have you managed to fix the problem? Also, do you have other issues similar to those I have described?