ikmalsaid commited on
Commit
743b185
1 Parent(s): 5a9b7ff

Implemented a method to convert reference audio to mono prior to processing.

Browse files
Files changed (1) hide show
  1. app.py +2 -0
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.")