Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -335,9 +335,12 @@ def voice_conversion(input, reference, steps, guidance, speed):
|
|
335 |
final_audio = butter_bandpass_filter_filtfilt(final_audio)
|
336 |
print("[INFO] | Final audio smoothed with low-pass filter.")
|
337 |
|
338 |
-
|
339 |
-
|
340 |
-
|
|
|
|
|
|
|
341 |
|
342 |
# Save the audio to a temporary WAV file
|
343 |
print("[INFO] | Saving final audio to a temporary WAV file.")
|
|
|
335 |
final_audio = butter_bandpass_filter_filtfilt(final_audio)
|
336 |
print("[INFO] | Final audio smoothed with low-pass filter.")
|
337 |
|
338 |
+
noise_duration = 0.5 # in seconds
|
339 |
+
noise_sample = final_audio[:int(noise_duration * sr_current)]
|
340 |
+
|
341 |
+
# Perform noise reduction
|
342 |
+
final_audio = nr.reduce_noise(y=final_audio, sr=sr_current, y_noise=noise_sample, prop_decrease=1.0)
|
343 |
+
print("[INFO] | Final audio noise reduced using noisereduce with noise sample.")
|
344 |
|
345 |
# Save the audio to a temporary WAV file
|
346 |
print("[INFO] | Saving final audio to a temporary WAV file.")
|