Recording Voice Onset

Hello,

I have been exploring the possibility of recording voice onset with the builder. I used this demo psychopy/psychopy/demos/builder/Experiments/stroopVoice at release · psychopy/psychopy but it seems the voice onset is zero for every trial. I have seen across different threads this may be a shared issue, but I could not find any thread mentioning a solution to get reliable voice onset. I am curious to see if someone has been able to develop a reliable approach to get voice onset.

Best,

Simon

I haven’t got transcription working successfully yet, but I have had success with recording voice onset.

Begin Routine

threshold = float(expInfo['mic threshold'])
wordOnset = 0
wordOffset = 0
minOnset = .3

Each Frame

micVol = mic.device.getCurrentVolume(timeframe=.1)
if hasattr(micVol, "__len__"):
    if t < minOnset:
        pass
    elif micVol[0] > threshold * 2 and wordOnset == 0:
        wordOnset = t-.1
    elif micVol[0] < threshold * 1.5 and wordOnset > 0 and wordOffset == 0:
        wordOffset = t-.1

End Routine

thisExp.addData('Onset',wordOnset)
thisExp.addData('Offset',wordOffset)

Try with a threshold of .1 and see how you get on.

Alternatively you could use similar code during the ITI to measure the background noise.

You can also set the size of a polygon to change each frame based on micVol so you can see how it responds.