From 9f28b005f34bba1ccbb64298108324b0e02ced81 Mon Sep 17 00:00:00 2001 From: James Betker Date: Thu, 21 Apr 2022 15:19:36 -0600 Subject: [PATCH] update read to output concatenated audio --- read.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/read.py b/read.py index d3128ac..9e0bc0c 100644 --- a/read.py +++ b/read.py @@ -67,7 +67,12 @@ if __name__ == '__main__': for cond_path in cond_paths: c = load_audio(cond_path, 22050) conds.append(c) + all_parts = [] for j, text in enumerate(texts): gen = tts.tts_with_preset(text, conds, preset=args.preset, clvp_cvvp_slider=args.voice_diversity_intelligibility_slider) - torchaudio.save(os.path.join(voice_outpath, f'{j}.wav'), gen.squeeze(0).cpu(), 24000) + gen = gen.squeeze(0).cpu() + torchaudio.save(os.path.join(voice_outpath, f'{j}.wav'), gen, 24000) + all_parts.append(gen) + full_audio = torch.cat(all_parts, dim=-1) + torchaudio.save(os.path.join(voice_outpath, 'combined.wav'), full_audio, 24000)