Skip to content

Commit

Permalink
Support new segments.json format (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
loubbrad committed Sep 11, 2024
1 parent bd06bc6 commit 3e20c33
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion amt/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,16 @@ def transcribe(
for audio_path in file_paths:
abs_audio_path = os.path.abspath(audio_path)
if segments_by_audio_file.get(abs_audio_path, None) is not None:
# "segments": [start_s, end_s, segment_avg_score]
_segments = [
[_start, _end]
for _start, _end, _ in segments_by_audio_file[abs_audio_path][
"segments"
]
]
file_info = {
"path": abs_audio_path,
"segments": segments_by_audio_file[abs_audio_path]["segments"],
"segments": _segments,
}
else:
file_info = {"path": abs_audio_path}
Expand Down

0 comments on commit 3e20c33

Please sign in to comment.