Spaces:
Running
Running
Update speechscore.py
Browse files- speechscore.py +6 -2
speechscore.py
CHANGED
|
@@ -58,9 +58,13 @@ class ScoresList:
|
|
| 58 |
return
|
| 59 |
results = {}
|
| 60 |
if isinstance(test_path, tuple):
|
| 61 |
-
sr,
|
| 62 |
if sr != 16000:
|
| 63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
for score in self.scores:
|
| 65 |
result_score = score.scoring(data, window, score_rate)
|
| 66 |
results[score.name] = result_score
|
|
|
|
| 58 |
return
|
| 59 |
results = {}
|
| 60 |
if isinstance(test_path, tuple):
|
| 61 |
+
sr, audio = test_path
|
| 62 |
if sr != 16000:
|
| 63 |
+
audio = resampy.resample(audio, sr, 16000, axis=0)
|
| 64 |
+
data = {}
|
| 65 |
+
data['audio'] = audio
|
| 66 |
+
data['rate'] = 16000
|
| 67 |
+
|
| 68 |
for score in self.scores:
|
| 69 |
result_score = score.scoring(data, window, score_rate)
|
| 70 |
results[score.name] = result_score
|