#! /usr/bin/env python
import subprocess
from time import sleep

# requires: espeak to be installed

waittimes = [1,2,1,4,1,4,1,4,1,4]

f=open("instructions.txt","r")
txt=f.readlines() 

for i, line in enumerate(txt):
        waittime = waittimes[i]
	print i, waittime  #, line, 
        subprocess.call(["espeak", line, "-v", "en"]) # character speaks: his/her line                
        sleep(waittime) # make pause after each text line
 