Spaces:
Running
on
T4
Running
on
T4
gorkemgoknar
commited on
Commit
·
00e2817
1
Parent(s):
9115bac
remove lowpass_highpass filter
Browse files
app.py
CHANGED
@@ -78,7 +78,7 @@ def predict(prompt, language, audio_file_pth, mic_file_path, use_mic,no_lang_aut
|
|
78 |
try:
|
79 |
# Filtering for microphone input, as it has BG noise, maybe silence in beginning and end
|
80 |
# This is fast filtering not perfect
|
81 |
-
lowpass_highpass="lowpass=5000,highpass=200"
|
82 |
|
83 |
fast_denoise="afftdn=nr=12:nf=-25"
|
84 |
# better to remove silence in beginning and end for microphone
|
@@ -87,7 +87,7 @@ def predict(prompt, language, audio_file_pth, mic_file_path, use_mic,no_lang_aut
|
|
87 |
out_filename = mic_file_path + str(uuid.uuid4()) + ".wav" #ffmpeg to know output format
|
88 |
|
89 |
#we will use newer ffmpeg as that has afftn denoise filter
|
90 |
-
shell_command = f"./ffmpeg -y -i {mic_file_path} -af {
|
91 |
|
92 |
command_result = subprocess.run([item for item in shell_command], capture_output=False,text=True, check=True)
|
93 |
speaker_wav=out_filename
|
|
|
78 |
try:
|
79 |
# Filtering for microphone input, as it has BG noise, maybe silence in beginning and end
|
80 |
# This is fast filtering not perfect
|
81 |
+
#lowpass_highpass="lowpass=5000,highpass=200"
|
82 |
|
83 |
fast_denoise="afftdn=nr=12:nf=-25"
|
84 |
# better to remove silence in beginning and end for microphone
|
|
|
87 |
out_filename = mic_file_path + str(uuid.uuid4()) + ".wav" #ffmpeg to know output format
|
88 |
|
89 |
#we will use newer ffmpeg as that has afftn denoise filter
|
90 |
+
shell_command = f"./ffmpeg -y -i {mic_file_path} -af {fast_denoise},{trim_silence},loudnorm {out_filename}".split(" ")
|
91 |
|
92 |
command_result = subprocess.run([item for item in shell_command], capture_output=False,text=True, check=True)
|
93 |
speaker_wav=out_filename
|