Skip to content

Diarizer AssertionError: window size validation fails for short audio clips #4572

Closed

Description

@beastoin

Summary

Speaker diarization endpoint /v2/embedding failing with AssertionError when processing short audio clips (~25ms). 100 errors/hour on production.

Error

AssertionError: choose a window size 400 that is [2, 7]

Stack Trace

pyannote/audio/models/embedding/wespeaker/__init__.py:135 (compute_fbank)
torchaudio/compliance/kaldi.py:591 (fbank)
torchaudio/compliance/kaldi.py:142 (_get_waveform_and_window_properties)

Code Path

  1. POST /v2/embedding → backend/diarizer/main.py:23
  2. embedding_endpoint_v2() → backend/diarizer/embedding.py:61
  3. embedding_inference_v2(file_path) → line 82
  4. pyannote wespeaker model → torchaudio fbank

Root Cause

Audio files with ~400 samples (~25ms at 16kHz) are too short for wespeaker fbank minimum window size. Audio clips being sent have invalid/truncated duration.

Impact

  • Severity: Critical (500 errors on diarizer.omi.me)
  • Frequency: 100 errors/hour
  • Affected pod: prod-omi-diarizer-7458c4c8db-rc4mj

Recommended Fix

  1. Add audio duration validation before calling embedding endpoint
  2. In backend/utils/stt/speaker_embedding.py - validate audio length before POST to /v2/embedding
  3. Minimum audio duration should be ~100ms+ for speaker embedding

Evidence

Raw logs: /tmp/diarizer-errors.json (on monitoring host)

Activity

  1. added
    understand
    p0
    maintainer
    on Feb 2, 2026
  2. beastoin commented on Feb 3, 2026

    @beastoin
    CollaboratorAuthor

    Need to trace the usages of the function in backend/utils/stt/speaker_embedding.py to find the potential root cause before creating a fix.

  3. self-assigned this
    on Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

maintainerp0understand

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions