Spaces:
Runtime error
Runtime error
Rehman1603
commited on
Commit
•
ad7ff93
1
Parent(s):
53978c9
Create Clear_voice.py
Browse files- Clear_voice.py +16 -0
Clear_voice.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from df.enhance import enhance, init_df, load_audio, save_audio
|
2 |
+
from df.utils import download_file
|
3 |
+
|
4 |
+
def Clear_voice():
|
5 |
+
# Load default model
|
6 |
+
out_path="enhanced.wav"
|
7 |
+
model, df_state, _ = init_df()
|
8 |
+
# Download and open some audio file. You use your audio files here
|
9 |
+
audio_path = "audio_chunk_1.wav"
|
10 |
+
audio, _ = load_audio(audio_path, sr=df_state.sr())
|
11 |
+
# Denoise the audio
|
12 |
+
enhanced = enhance(model, df_state, audio)
|
13 |
+
# Save for listening
|
14 |
+
save_audio(out_path, enhanced, df_state.sr())
|
15 |
+
return out_path
|
16 |
+
|