A way to trigger microphone? Voicekey creating errors

OS: MacOS Monterey 12.6
PsychoPy version: v2021.2.3

What are you trying to achieve?: My experiment involves seeing half of a word as a cue and then responding with the other half of the word (cue: BAN; response: DIT). If participants take too long to respond, a buzzer plays and text appears on the screen to “Respond faster.”

I was able to achieve this when participants had to type their responses, but now I would like participants to speak their responses into a microphone. Is there a way of triggering the mic functionality in PsychoPy so that it knows a participant has or has not begun speaking? This is so that the buzzer and message can be presented automatically if there is no response.

I tried just importing (import psychopy.voicekey as vk) Voicekey at the beginning of the experiment using Code in the Builder and got this error:

So I then copied libportaudio.dylib to the the pyo library.
Screen Shot 2022-09-14 at 13.50.49

And I’m still getting the same error as before, nothing has changed. Is there something I’m missing? I have not even started implementing voicekey into my code aside from trying to import it.

Thank you in advance!

Maybe this is what you are looking for: psychopy.voicekey - Real-time sound processing — PsychoPy v2022.2.4

1 Like

Hi! Thank you so much for your response. I’ve adjusted my question to ask precisely what I was trying to get at. This suggestion was useful, but now I am getting errors trying to implement voicekey into my code.

Are there any demos of experiments using the voicekey onset function publicly available? I tried searching through the PsychoPy demos page and couldn’t find anything.

This seems to be an issue on Mac: Portaudio error