fix double audio issue

#3
by akhaliq HF staff - opened
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -8,7 +8,8 @@ pipeline = pipeline.to("cuda")
8
 
9
  def denoise(length_sec):
10
  audios = pipeline(audio_length_in_s=length_sec).audios
11
- scipy.io.wavfile.write("maestro_test.wav", pipeline.unet.sample_rate, audios)
 
12
  return "maestro_test.wav"
13
 
14
  gr.Interface(fn=denoise, inputs=gr.Slider(1.0, 6.0, value=3.0, step=0.5, label="Audio length in seconds"), outputs="audio").launch()
 
8
 
9
  def denoise(length_sec):
10
  audios = pipeline(audio_length_in_s=length_sec).audios
11
+ for audio in audios:
12
+ scipy.io.wavfile.write("maestro_test.wav", pipe.unet.sample_rate, audio.transpose())
13
  return "maestro_test.wav"
14
 
15
  gr.Interface(fn=denoise, inputs=gr.Slider(1.0, 6.0, value=3.0, step=0.5, label="Audio length in seconds"), outputs="audio").launch()