Help/ advice for recording verbal response and its onset time

Hi Psychopy community,

I am trying to record audio responses and calculate voice onset time. I have two plans here:

1 psychopy.sound.Microphone:

mic=Microphone(audioLatencyMode=1,streamBufferSecs=10)

mic_onset=mic.start(when=0,waitForStart=1)

core.wait(5)

mic.stop()

audioClip=mic.getRecording()

audioClip.save(filename)

My question is the mic_onset is the absolute time, how I can accurately calculate the verbal response time?

2 psychopy.voiceKey Recording audio responses and voice onset times

voicekey.pyo_init(rate=44100,buffersize=32)
voice_file_path=generate_filename()
onset_voicekey=voicekey.OnsetVoiceKey(sec=5, file_out=voice_file_path)
onset_voicekey.start()
core.wait(2)
rt=onset_voicekey.event_onset

I have tested the function, the audio file and response time are not accurately detected. Only a few files and response times are created. Is it related to my code or my device? Do I have to use a professional microphone as an input device?

Thank you very muck for your opinions.

Guan