ikmalsaid commited on
Commit
1c48544
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_local.py +2 -0
app_local.py CHANGED
@@ -86,6 +86,8 @@ def infer(ref_audio_orig, ref_text, gen_text, exp_name, remove_silence):
86
  gr.Info("Converting audio...")
87
  with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as f:
88
  aseg = AudioSegment.from_file(ref_audio_orig)
 
 
89
  audio_duration = len(aseg)
90
  if audio_duration > 15000:
91
  gr.Warning("Audio is over 15s, clipping to only first 15s.")
 
86
  gr.Info("Converting audio...")
87
  with tempfile.NamedTemporaryFile(delete=False, suffix=".wav") as f:
88
  aseg = AudioSegment.from_file(ref_audio_orig)
89
+ # Convert to mono
90
+ aseg = aseg.set_channels(1)
91
  audio_duration = len(aseg)
92
  if audio_duration > 15000:
93
  gr.Warning("Audio is over 15s, clipping to only first 15s.")