Spaces:
Running
Running
Update speechscore.py
Browse files- speechscore.py +5 -3
speechscore.py
CHANGED
|
@@ -53,17 +53,19 @@ class ScoresList:
|
|
| 53 |
score_rate:
|
| 54 |
the sampling rate specified for scoring the files.
|
| 55 |
"""
|
|
|
|
|
|
|
| 56 |
if test_path is None:
|
| 57 |
print(f'Please provide audio path for test_path')
|
| 58 |
return
|
| 59 |
results = {}
|
| 60 |
if isinstance(test_path, tuple):
|
| 61 |
sr, audio = test_path
|
| 62 |
-
if sr !=
|
| 63 |
-
audio = resampy.resample(audio, sr,
|
| 64 |
data = {}
|
| 65 |
data['audio'] = [audio]
|
| 66 |
-
data['rate'] =
|
| 67 |
|
| 68 |
for score in self.scores:
|
| 69 |
result_score = score.scoring(data, window, score_rate)
|
|
|
|
| 53 |
score_rate:
|
| 54 |
the sampling rate specified for scoring the files.
|
| 55 |
"""
|
| 56 |
+
if score_rate is None:
|
| 57 |
+
score_rate = 16000
|
| 58 |
if test_path is None:
|
| 59 |
print(f'Please provide audio path for test_path')
|
| 60 |
return
|
| 61 |
results = {}
|
| 62 |
if isinstance(test_path, tuple):
|
| 63 |
sr, audio = test_path
|
| 64 |
+
if sr != score_rate:
|
| 65 |
+
audio = resampy.resample(audio, sr, score_rate, axis=0)
|
| 66 |
data = {}
|
| 67 |
data['audio'] = [audio]
|
| 68 |
+
data['rate'] = score_rate
|
| 69 |
|
| 70 |
for score in self.scores:
|
| 71 |
result_score = score.scoring(data, window, score_rate)
|