|
@@ -0,0 +1,37 @@
|
|
|
+import pyttsx3
|
|
|
+import rpyc
|
|
|
+import random
|
|
|
+import time
|
|
|
+import codecs
|
|
|
+import os
|
|
|
+fr=codecs.open('/tmp/script.txt','r','u-tf8')
|
|
|
+lines=fr.readlines()
|
|
|
+fr.close()
|
|
|
+txt=lines[0].strip()
|
|
|
+
|
|
|
+engine = pyttsx3.init()
|
|
|
+engine.setProperty('rate',175)
|
|
|
+engine.save_to_file(txt, '/tmp/ok2.mp3')
|
|
|
+
|
|
|
+engine.runAndWait()
|
|
|
+
|
|
|
+
|
|
|
+val=random.randint(1000000,9999999)
|
|
|
+os.chdir('/home/jared/Wav2Lip-master')
|
|
|
+os.system('./proc.sh '+str(val)+' &')
|
|
|
+
|
|
|
+
|
|
|
+while True:
|
|
|
+ print('waiting...')
|
|
|
+ if os.path.exists('/tmp/results/'+str(val)):
|
|
|
+ break
|
|
|
+ time.sleep(5)
|
|
|
+ print('waiting...')
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+os.system('cp /home/jared/Wav2Lip-master/results/result_voice.mp4 /tmp')
|
|
|
+os.chdir('/home/jared/tests/libopenshot')
|
|
|
+os.system('python3 jaredtest.py')
|
|
|
+os.system('cp /tmp/out.mp4 /var/www/html/out.mp4')
|
|
|
+os.system('telegram-send "video is ready, http://139.162.121.30:54321/out.mp4"')
|