Validate input sid (#369)

This commit is contained in:
Fangjun Kuang
2023-10-18 14:02:01 +08:00
committed by GitHub
parent 1ee79e3ff5
commit 8545c3b7f0
8 changed files with 51 additions and 14 deletions

View File

@@ -124,6 +124,11 @@ def main():
start = time.time()
audio = tts.generate(args.text, sid=args.sid)
end = time.time()
if len(audio.samples) == 0:
print("Error in generating audios. Please read previous error messages.")
return
elapsed_seconds = end - start
audio_duration = len(audio.samples) / audio.sample_rate
real_time_factor = elapsed_seconds / audio_duration