karlhajal ahk-d commited on
Commit
abb6d41
·
verified ·
1 Parent(s): 2021a20

Update app.py (#5)

Browse files

- Update app.py (660e2fe710f5c8140dfea16b092fc35f03cdf758)


Co-authored-by: ahk-d <ahk-d@users.noreply.huggingface.co>

Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -8,11 +8,12 @@ import tempfile
8
  import matplotlib.pyplot as plt
9
  import os
10
  from src.pronunciation_checker import PronunciationChecker
11
- from src.audio_preprocessing import assess_pronunciation_quality
12
  from datetime import datetime
13
  from pathlib import Path
14
  import re
15
 
 
16
  @spaces.GPU
17
  def check_pronunciation(reference_audio, input_audio, threshold, wavlm_layer, labels_data=None, input_number=None):
18
  wavlm_layer = int(wavlm_layer)
@@ -31,6 +32,11 @@ def check_pronunciation(reference_audio, input_audio, threshold, wavlm_layer, la
31
 
32
  comparison_wav, _ = pronunciation_checker.preprocess_wav(input_audio)
33
  log_timing("Input Audio Preprocessing")
 
 
 
 
 
34
 
35
  # Check if waveforms are not empty
36
  if ref_wav is None or comparison_wav is None:
 
8
  import matplotlib.pyplot as plt
9
  import os
10
  from src.pronunciation_checker import PronunciationChecker
11
+ from src.audio_preprocessing import assess_pronunciation_quality, denoise_audio
12
  from datetime import datetime
13
  from pathlib import Path
14
  import re
15
 
16
+
17
  @spaces.GPU
18
  def check_pronunciation(reference_audio, input_audio, threshold, wavlm_layer, labels_data=None, input_number=None):
19
  wavlm_layer = int(wavlm_layer)
 
32
 
33
  comparison_wav, _ = pronunciation_checker.preprocess_wav(input_audio)
34
  log_timing("Input Audio Preprocessing")
35
+
36
+
37
+ # ref_wav = denoise_audio(ref_wav)
38
+ comparison_wav = denoise_audio(comparison_wav)
39
+ log_timing("Audio Denoising")
40
 
41
  # Check if waveforms are not empty
42
  if ref_wav is None or comparison_wav is None: