Update modules/vad/silero_vad.py
Browse files
modules/vad/silero_vad.py
CHANGED
@@ -250,13 +250,9 @@ class SileroVAD:
|
|
250 |
ts_map = SpeechTimestampsMap(speech_chunks, sampling_rate)
|
251 |
|
252 |
for segment in segments:
|
253 |
-
|
254 |
-
segment["end"] = ts_map.get_original_time(segment["end"])
|
255 |
-
|
256 |
-
for segment in segments:
|
257 |
-
if segment.words:
|
258 |
words = []
|
259 |
-
for word in segment
|
260 |
# Ensure the word start and end times are resolved to the same chunk.
|
261 |
middle = (word.start + word.end) / 2
|
262 |
chunk_index = ts_map.get_chunk_index(middle)
|
|
|
250 |
ts_map = SpeechTimestampsMap(speech_chunks, sampling_rate)
|
251 |
|
252 |
for segment in segments:
|
253 |
+
if segment["words"]:
|
|
|
|
|
|
|
|
|
254 |
words = []
|
255 |
+
for word in segment["words"]:
|
256 |
# Ensure the word start and end times are resolved to the same chunk.
|
257 |
middle = (word.start + word.end) / 2
|
258 |
chunk_index = ts_map.get_chunk_index(middle)
|