Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -189,7 +189,7 @@ def add_voice_labelv2(json_file, audio_path):
|
|
189 |
speech_probs.append(speech_prob)
|
190 |
vad_iterator.reset_states() # reset model states after each audio
|
191 |
|
192 |
-
voice_idxs = np.where(speech_probs >= 0.7)
|
193 |
if len(voice_idxs) == 0:
|
194 |
print("NO VOICE SEGMENTS DETECTED!")
|
195 |
try:
|
@@ -212,8 +212,8 @@ def add_voice_labelv2(json_file, audio_path):
|
|
212 |
end_seconds = (end_time - end_minutes) * 60
|
213 |
|
214 |
data['vocal_times'] = {
|
215 |
-
"start_time": f"{start_minutes}.{start_seconds}",
|
216 |
-
"end_time": f"{end_minutes}.{end_seconds}"
|
217 |
}
|
218 |
|
219 |
begin_seq = True
|
|
|
189 |
speech_probs.append(speech_prob)
|
190 |
vad_iterator.reset_states() # reset model states after each audio
|
191 |
|
192 |
+
voice_idxs = np.where(np.array(speech_probs) >= 0.7)
|
193 |
if len(voice_idxs) == 0:
|
194 |
print("NO VOICE SEGMENTS DETECTED!")
|
195 |
try:
|
|
|
212 |
end_seconds = (end_time - end_minutes) * 60
|
213 |
|
214 |
data['vocal_times'] = {
|
215 |
+
"start_time": f"{start_minutes}.{start_seconds.2f}",
|
216 |
+
"end_time": f"{end_minutes}.{end_seconds.2f}"
|
217 |
}
|
218 |
|
219 |
begin_seq = True
|