Hi,
I’m new to PsychoPy and would be very grateful for some advice.
I would like to record verbal responses and voice onset times. However, I would also like to transcribe these verbal responses.
If I use the microphone component from the builder, I can transcribe my responses using the Whisper plugin. However, the voice onset times are usually incorrect (almost always 0.0) this way. And PsychoPy freezes often for a few minutes during the first transcription.
That’s why I decided to record the responses and calculate the voice onset times using voicekey. Both the recording and the times seem to work reliably. However, I am failing to have the transcription output here. Do you have any idea how to transcribe the audio file I recorded with the voicekey code component?
Thank you for your help!
Here is my relevant code:
# Begin experiment
import psychopy.voicekey as vk
vk.pyo_init(rate=44100, buffersize=256)
from psychopy.voicekey.demo_vks import DemoVoiceKeySignal as Signaler
# Begin Routine
### Create a voice-key to be used:
vpvk = vk.OnsetVoiceKey(
sec=8,
file_out='data/trial_'+str(trials.thisN).zfill(3)+'_'+'.wav')
### Start it recording (and detecting):
vpvk.start() # non-blocking; don't block when using Builder
# End Routine
### The recorded sound is saved upon .stop() by default. But
### its a good idea to call .stop() explicitly, eg, if there's much slippage:
vpvk.stop()
### Add the detected time into the PsychoPy data file:
thisExp.addData('vocal_RT', round(vpvk.event_onset, 3))
thisExp.addData('bad_baseline', vpvk.bad_baseline)
thisExp.addData('filename', vpvk.filename)
thisExp.nextEntry()