mudler/LocalAI · error
error: failed to detect speech
Error message
error: failed to detect speech
What it means
Voice activity detection failed on the input audio. Guard: validate the audio buffer is non-empty and in the expected sample format before running VAD; report the failure to the caller.
Source
Thrown at backend/go/whisper/cpp/gowhisper.cpp:113
struct whisper_vad_context_params vcparams =
whisper_vad_default_context_params();
// XXX: Overridden to false in upstream due to performance?
// vcparams.use_gpu = true;
vctx = whisper_vad_init_from_file_with_params(model_path, vcparams);
if (vctx == nullptr) {
fprintf(stderr, "error: Failed to init model as VAD\n");
return 1;
}
return 0;
}
int vad(float pcmf32[], size_t pcmf32_len, float **segs_out,
size_t *segs_out_len) {
if (!whisper_vad_detect_speech(vctx, pcmf32, pcmf32_len)) {
fprintf(stderr, "error: failed to detect speech\n");
return 1;
}
struct whisper_vad_params params = whisper_vad_default_params();
struct whisper_vad_segments *segs =
whisper_vad_segments_from_probs(vctx, params);
size_t segn = whisper_vad_segments_n_segments(segs);
// fprintf(stderr, "Got segments %zd\n", segn);
flat_segs.clear();
for (int i = 0; i < segn; i++) {
flat_segs.push_back(whisper_vad_segments_get_segment_t0(segs, i));
flat_segs.push_back(whisper_vad_segments_get_segment_t1(segs, i));
}
// fprintf(stderr, "setting out variables: %p=%p -> %p, %p=%zx -> %zx\n",View on GitHub (pinned to 44413a9d06)
Solutions
- Verify the audio input is valid and contains detectable speech.
- Check sample rate/format of the input audio matches what whisper expects (16 kHz PCM).
- Inspect earlier logs for VAD model init problems.
When it happens
Trigger: Thrown at backend/go/whisper/cpp/gowhisper.cpp:113 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of mudler/LocalAI@44413a9d06 (2026-08-15).
Data as JSON: /api/errors/037a41794520fd15.
Report an issue: GitHub.