deleted useless files
parent
3ef1b59c91
commit
0a2a7346b0
@ -1,35 +0,0 @@
|
|||||||
#! /usr/bin/env python
|
|
||||||
import re, subprocess, random
|
|
||||||
from time import sleep
|
|
||||||
|
|
||||||
# requires: espeak to be installed
|
|
||||||
|
|
||||||
dic={
|
|
||||||
"narrator": "en-us",
|
|
||||||
}
|
|
||||||
|
|
||||||
f=open("detail_of_attack.txt","r")
|
|
||||||
txt=f.readlines()
|
|
||||||
for line in txt:
|
|
||||||
print line
|
|
||||||
# play time
|
|
||||||
subprocess.call(["espeak", "-v", dic['narrator'], "-p", "20"]) # narrator speaks: time and character
|
|
||||||
sleep(0.5) #short pause before sentence
|
|
||||||
print sentence
|
|
||||||
if "*CLASSIFIED*" in sentence: #"*expletive*" in sentence is True:
|
|
||||||
sentence_parts=re.split(r"(\*\w+\*)", sentence)
|
|
||||||
print sentence_parts
|
|
||||||
for part in sentence_parts:
|
|
||||||
if part == '*CLASSIFIED*':
|
|
||||||
print 'EXPLETIVE', part
|
|
||||||
subprocess.call(["aplay", 'swear.wav'])
|
|
||||||
else:
|
|
||||||
print 'SPEECH', part
|
|
||||||
subprocess.call(["espeak", part, "-v", voice]) # character speaks: his
|
|
||||||
sleep(float(random.randint(1,10))/100)
|
|
||||||
else: # line w/out time or character (narrator)
|
|
||||||
print "NARRATOR"
|
|
||||||
subprocess.call(["espeak", line, "-v", dic['narrator'], "-p", "20"])
|
|
||||||
|
|
||||||
sleep(1) # make pause after each text line
|
|
||||||
|
|
Loading…
Reference in New Issue