Spaces:
Running
on
Zero
Running
on
Zero
mrfakename
commited on
Commit
•
de3a90d
1
Parent(s):
5a9b7ff
Update app.py
Browse files
app.py
CHANGED
@@ -110,7 +110,9 @@ def infer(ref_audio_orig, ref_text, gen_text, exp_name, remove_silence):
|
|
110 |
else:
|
111 |
gr.Info("Using custom reference text...")
|
112 |
audio, sr = torchaudio.load(ref_audio)
|
113 |
-
|
|
|
|
|
114 |
rms = torch.sqrt(torch.mean(torch.square(audio)))
|
115 |
if rms < target_rms:
|
116 |
audio = audio * target_rms / rms
|
|
|
110 |
else:
|
111 |
gr.Info("Using custom reference text...")
|
112 |
audio, sr = torchaudio.load(ref_audio)
|
113 |
+
# Audio
|
114 |
+
if audio.shape[0] > 1:
|
115 |
+
audio = torch.mean(audio, dim=0, keepdim=True)
|
116 |
rms = torch.sqrt(torch.mean(torch.square(audio)))
|
117 |
if rms < target_rms:
|
118 |
audio = audio * target_rms / rms
|