Spaces:
Sleeping
Sleeping
Commit
·
862eecb
1
Parent(s):
8a3caba
Update tts.py
Browse files
tts.py
CHANGED
@@ -6,6 +6,8 @@ import ffmpeg
|
|
6 |
import shutil
|
7 |
import argparse
|
8 |
|
|
|
|
|
9 |
def adjust_speed(input_file, speed_factor):
|
10 |
output_file = input_file.replace(".wav", "_adjusted.wav")
|
11 |
ffmpeg.input(input_file).filter('atempo', speed_factor).output(output_file, acodec='pcm_s16le').run()
|
@@ -87,8 +89,6 @@ def main(speaker_directory, aligned_text_file, output_audio_file):
|
|
87 |
shutil.rmtree('./audio/temp')
|
88 |
|
89 |
if __name__ == "__main__":
|
90 |
-
os.environ["COQUI_TOS_AGREED"] = "1"
|
91 |
-
|
92 |
parser = argparse.ArgumentParser(description="Generate speech from translated text")
|
93 |
parser.add_argument("speaker_directory", help="Directory containing speaker voice clips")
|
94 |
parser.add_argument("aligned_text_file", help="Path to the translated and aligned text file")
|
|
|
6 |
import shutil
|
7 |
import argparse
|
8 |
|
9 |
+
os.environ["COQUI_TOS_AGREED"] = "1"
|
10 |
+
|
11 |
def adjust_speed(input_file, speed_factor):
|
12 |
output_file = input_file.replace(".wav", "_adjusted.wav")
|
13 |
ffmpeg.input(input_file).filter('atempo', speed_factor).output(output_file, acodec='pcm_s16le').run()
|
|
|
89 |
shutil.rmtree('./audio/temp')
|
90 |
|
91 |
if __name__ == "__main__":
|
|
|
|
|
92 |
parser = argparse.ArgumentParser(description="Generate speech from translated text")
|
93 |
parser.add_argument("speaker_directory", help="Directory containing speaker voice clips")
|
94 |
parser.add_argument("aligned_text_file", help="Path to the translated and aligned text file")
|