feat: concise reports
This commit is contained in:
parent
12a4948425
commit
b2db9d8d41
1 changed files with 3 additions and 3 deletions
6
tts.py
6
tts.py
|
@ -72,7 +72,7 @@ def generate_audio(generator, name, voice):
|
||||||
output_files.append(output_file_name)
|
output_files.append(output_file_name)
|
||||||
sf.write(output_file_name, audio, 24000)
|
sf.write(output_file_name, audio, 24000)
|
||||||
generation_time = time() - start_time
|
generation_time = time() - start_time
|
||||||
print(f"Generated {len(output_files)} chunks in {generation_time:.2f} seconds")
|
print(f"{len(output_files)} chunks in {generation_time:.2f} seconds")
|
||||||
return output_files
|
return output_files
|
||||||
|
|
||||||
def play_audio(output_files):
|
def play_audio(output_files):
|
||||||
|
@ -110,12 +110,12 @@ def main():
|
||||||
generator = pipeline(text, voice=voice)
|
generator = pipeline(text, voice=voice)
|
||||||
output_files = generate_audio(generator, name, voice)
|
output_files = generate_audio(generator, name, voice)
|
||||||
if args.skip_play:
|
if args.skip_play:
|
||||||
print("Audio player disabled. Generated:", output_files)
|
print("Audio player disabled.", f"{name}-{voice}-#.wav")
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
play_audio(output_files)
|
play_audio(output_files)
|
||||||
except:
|
except:
|
||||||
print("Something went wrong when trying to play the audio files. Try `--skip_play` and play the output files manually:", output_files)
|
print("Something went wrong when trying to play the audio files. Try `--skip_play` and play the output files manually.")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Reference in a new issue