Remove trailing silence from audio files

This commit is contained in:
3djc
2017-04-10 13:16:39 +02:00
parent 0a1cacf77c
commit 9c19889309
+3 -2
View File
@@ -27,7 +27,9 @@ sys.path.append(lib_path)
def generate(str, filename): def generate(str, filename):
command = "pico2wave -l=" + voice + " -w=" + filename + " \"" + str + "\"" command = "pico2wave -l=" + voice + " -w=output.wav \"" + str + "\""
os.system(command.encode('utf-8'))
command = "sox output.wav " + filename + " reverse silence 1 0.1 0.1% reverse"
os.system(command.encode('utf-8')) os.system(command.encode('utf-8'))
################################################################ ################################################################
@@ -102,4 +104,3 @@ if __name__ == "__main__":
for s, f in sounds: for s, f in sounds:
if s and f: if s and f:
generate(s, f) generate(s, f)