Spaces:
Running
on
Zero
Running
on
Zero
Implemented a method to convert reference audio to mono prior to processing.
Browse files
app.py
CHANGED
@@ -84,6 +84,8 @@ def infer(ref_audio_orig, ref_text, gen_text, exp_name, remove_silence):
|
|
84 |
gr.Info("Converting audio...")
|
85 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as f:
|
86 |
aseg = AudioSegment.from_file(ref_audio_orig)
|
|
|
|
|
87 |
audio_duration = len(aseg)
|
88 |
if audio_duration > 15000:
|
89 |
gr.Warning("Audio is over 15s, clipping to only first 15s.")
|
|
|
84 |
gr.Info("Converting audio...")
|
85 |
with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as f:
|
86 |
aseg = AudioSegment.from_file(ref_audio_orig)
|
87 |
+
# Convert to mono
|
88 |
+
aseg = aseg.set_channels(1)
|
89 |
audio_duration = len(aseg)
|
90 |
if audio_duration > 15000:
|
91 |
gr.Warning("Audio is over 15s, clipping to only first 15s.")
|