Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix crash in speaker identification if segment starts less than 0.1s before audio end #388

Merged
merged 1 commit into from
Nov 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion worker/transcribee_worker/identify_speakers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ def time_to_sample(time: float | None):

segments = [
(
time_to_sample(child.children[0].start),
min(
time_to_sample(child.children[0].start),
# we always use at least 0.1s,
# otherwise the fingerprinting model explodes sometimes
# since the start of the segment might be less than 0.1s
# from end of the audio, we use this as a safety
len(audio) - time_to_sample(0.1),
),
max(
time_to_sample(child.children[-1].end),
# we always use at least 0.1s,
Expand Down