VoiceKey, incrrect reaction times from the Word naming demo

What are you trying to achieve?:

Hi all, I want to measure reaction time with speech voicekey (i.e. number, picture, word naming), defined as the time from a stimuli presentation and the first recorded speech segment. I was able to code a functional voicekey experiment in matlab’s psychotoolbox, and I would like to program the same in psychopy. But I am novice in python. Besides, I have spent quite some time collecting information in different corners of this forum, therefore I decided to insert these additional information which (hopefully) might serve other users.

OS (e.g. Win10): Win 10 (64 bit) (mic input in Mac seem more complicated)
PsychoPy version: 2020.2.10
Hardware settings (are they correct?):
audio library [PTB, pygame,pyo,soundirect] (as recomended here)
audio driver [ASIO, directsound, Primary Sound, Audigy] (as recommended here)

What did you try to make it work?:
I tested the word naming demo.

The demo runs without errors, but the measured voicekey onsets are incorrect (for similar issue reports): around .16, as already reported:

  1. I firstly naively tried to implement this changes to the demo by @dvnonordheim. Namely changing the buffersize to 256 (here why). But I keep having the result of above. It also doesn’t appear to me to be a UNIX time incompatibility as suggested in the post.

  2. Is it microphone sensitivity? The reasoning is that .16 sec oddly resembles to one frame at 60 Hz. As I understand the voicekey activation is triggered when a given threshold surpasses the baseline. So I looked focused on those:
    Baseline: I understood that with .OffsetVoiceKey the threshold is checked on an already pre-processed baseline (bandpass filtered at: low 100, high 3000 Hz, source code here). Applying with audacity the band pass filters on the recorded sound from the demo, there is almost no amplitude during the “silent” part of the audio.
    Threshold From the manual I found the voicekey is based on an arbitrary threshold. So I tried to change the default threshold settings (which is 10) to various values, none changing the output i.e.:

vpvk = vk.OnsetVoiceKey(
sec=2, # seconds, how long shall the record last
file_out=‘data/trial_’+str(trials.thisN).zfill(3)+’_’+word+’.wav’, # audio output name
threshold = 20) # threshold

Word_naming_v2.psyexp (21.1 KB) conditions.csv (23 Bytes)

I tested in the quieter place possible. The new configuration settings were confirmed by outputting: thisExp.addData('Config', vpvk.config). I also don’t understand why the sound recorded (in the demo the playback) does not sound band-pass filtered.

I am a little confused now, and I believe I am missing something obvious. Any help or suggestions? :slight_smile:

FYI if you arrive here checking how to implement a voicekey: microphones are not (yet) compatible online. It also seems not possible to use it to trigger a new event.

Hi! In case it helps anyone, I was having the same issue while recording voice from the computer’s microphone device. The signal was not of good quality, thus producing a (false) voice detection around 160-170 ms. I just tested the exact same task this time with an external mic and it is now working just fine.