You can make a little change to the code of split_on_silence
function:
for range_i, range_ii in pairwise(output_ranges):
print(">>", timestamp(range_i[0]/1000), timestamp(range_i[1]/1000))
last_end = range_i[1]
next_start = range_ii[0]
if next_start < last_end:
range_i[1] = (last_end+next_start)//2
range_ii[0] = range_i[1]
Just add print line or make anything with those variable of range_i
which is seemingly the time of those crops. Didn't test the precision but it seem to be ok. This function is /pydub/silence.py
in your installation place.
Timestamp is just:
def timestamp(mseconds):
(hours, mseconds) = divmod(mseconds, 3600)
(minutes, mseconds) = divmod(mseconds, 60)
return f"{hours:02.0f}:{minutes:02.0f}:{mseconds:06.3f}"
used with datetime
library to be more exact.