name='prompt',
                         text='Respond as quickly as possible.',
                         font='Arial',
                         pos=(0, 0),
                         height=0.05,
                         wrapWidth=None,
                         ori=0,
                         color='white',
                         colorSpace='rgb',
                         opacity=1,
                         languageStyle='LTR',
                         depth=0.0)

# The import and pyo_init should always come early on:
import psychopy.voicekey as vk
vk.pyo_init(rate=44100, buffersize=256)

# What signaler class to use? Here just the demo signaler:
from psychopy.voicekey.demo_vks import DemoVoiceKeySignal as Signaler

# To use a LabJack as a signaling device:
#from voicekey.signal.labjack_vks import LabJackU3VoiceKeySignal as Signaler

# Initialize components for Routine "instr"
instrClock = core.Clock()
instructions_text = visual.TextStim(win=win,
                                    name='instructions_text',
                                    text='default text',
                                    font='Arial',
                                    pos=(0, 0),
                                    height=0.05,
Author:         Quinn Cabooter
Function:       Master's student
Affiliation:    Ghent University
Departement:    Theoretical and experimental psychology
Academic year:  2020-21
An experiment programmed for the RPEP course.
Paper: EFFECT OF VERBAL RESPONSE METHOD ON LEFT VISUAL FIELD ADVANTAGE
COMPARED TO MANUAL RESPONSE METHOD.
"""

#import modules
from psychopy import visual, event, core, gui, data
import os, pandas, time
import numpy as np
from psychopy import voicekey as vk
vk.pyo_init()

speedy = 0

# file management and participant info

## set the directory
my_directory = os.getcwd()

## construct the name of the folder that will hold the data
directory_to_write_to = my_directory + "/data"

## if the folder doesn't exist yet, make it
if not os.path.isdir(directory_to_write_to):
    os.mkdir(directory_to_write_to)
    os.mkdir(path)
if not os.path.exists(audio):
    os.mkdir(audio)

if os.path.exists(path + fileOut):
    sys.exit("File " + fileOut + " already exists!")

stimuli_list = pandas.read_csv(IMAGE_LIST).values
trials = random.sample(list(stimuli_list), len(stimuli_list))
for i in range(NBLOCK - 1):
    trials.extend([['break']])
    trials.extend(random.sample(list(stimuli_list), len(stimuli_list)))

responses = []  # output variable

voicekey.pyo_init()  # initialize software for voice recording

try:
    win = visual.Window(fullscr=FULL,
                        size=WINSIZE,
                        color=[1, 1, 1],
                        colorSpace='rgb',
                        units='pix')

    # All text stimuli

    fixation = visual.TextStim(win=win,
                               ori=0,
                               name='fixation',
                               text='+',
                               height=15,