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?

Hi there!
I suppose you did not find any solutions to the above. I am basically facing the exact same problems as you do (I am recording microphone responses to visual cues while playing acoustic distractors both via an audio interface):

  • I cannot get speech onsets (although, like you, I don’t care much about that anymore since a bug-free experiment would be already great).
  • My recording quality is very bad when audio latency is above 1.
  • From time to time, the experiment crashes randomly (in different blocks with different items).
  • Probably not related: the script does not record anything but white noise when it’s run on a different computer with the same audio interface (even though the interface works fine in other applications there). But I suppose this is related to something else (permission issues?).

Hi fhechler,

Just curious if you ever found a solution? It sounds like I’ve had a similar issue as you.

In my case, I had to lower my recording frequency to 16 k and that did the job. However, as you note, I’m still finding that my experiments will crash randomly. Really strange.

I see that @jens mentioned a solution to a somewhat related problem in this thread.

I’m not entirely sure if this is the same issue I’m having. In my task a person names a picture using a microphone connected to an external voicekey device that converts the utterance to a button press. That press serves to measure RT relative to picture onset. Randomly in our experiments a trial will just freeze and we’ll have to restart the experiment. It’s really frustrating and I’m not entirely sure what’s going on.

FG