Spaces:
Running
on
Zero
Running
on
Zero
roychao19477
commited on
Commit
·
2881f71
1
Parent(s):
ab0cc1f
Upload
Browse files
app.py
CHANGED
@@ -82,6 +82,9 @@ def enhance(filepath):
|
|
82 |
if orig_sr != 16000:
|
83 |
out = librosa.resample(out, orig_sr=16000, target_sr=orig_sr)
|
84 |
|
|
|
|
|
|
|
85 |
# write file
|
86 |
sf.write("enhanced.wav", out, orig_sr)
|
87 |
|
|
|
82 |
if orig_sr != 16000:
|
83 |
out = librosa.resample(out, orig_sr=16000, target_sr=orig_sr)
|
84 |
|
85 |
+
# Normalize
|
86 |
+
out = out / np.max(np.abs(out)) * 0.85
|
87 |
+
|
88 |
# write file
|
89 |
sf.write("enhanced.wav", out, orig_sr)
|
90 |
|