Remove trailing silence from audio files
This commit is contained in:
@@ -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)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user