|
|
|
@ -18,7 +18,7 @@ dic={
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
f=open("transcripts-drone-attack.txt","r")
|
|
|
|
|
f=open("/media/floppy/transcripts-drone-attack.txt","r")
|
|
|
|
|
txt=f.readlines()
|
|
|
|
|
p= re.compile(r"^(\d\d\:\d\d) \((.*?)\)\: (.*)") # regex for capturing groups: time, character, sentence
|
|
|
|
|
for line in txt:
|
|
|
|
@ -32,7 +32,7 @@ for line in txt:
|
|
|
|
|
sentence_parts=re.split(r"(\*\w+\*)", sentence)
|
|
|
|
|
for part in sentence_parts:
|
|
|
|
|
if part == '*expletive*':
|
|
|
|
|
subprocess.call(["aplay", 'swear.wav'], stdout=devnull, stderr=devnull)
|
|
|
|
|
subprocess.call(["aplay", '/media/floppy/swear.wav'], stdout=devnull, stderr=devnull)
|
|
|
|
|
else:
|
|
|
|
|
subprocess.call(["espeak", part, "-v", voice], stdout=devnull, stderr=devnull) # character speaks: his
|
|
|
|
|
sleep(float(random.randint(1,10))/100)
|
|
|
|
|