{"record":{"id":"037a41794520fd15","repo":"mudler/LocalAI","slug":"error-failed-to-detect-speech","errorCode":null,"errorMessage":"error: failed to detect speech\n","messagePattern":"error: failed to detect speech\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/go/whisper/cpp/gowhisper.cpp","lineNumber":113,"sourceCode":"  struct whisper_vad_context_params vcparams =\n      whisper_vad_default_context_params();\n\n  // XXX: Overridden to false in upstream due to performance?\n  // vcparams.use_gpu = true;\n\n  vctx = whisper_vad_init_from_file_with_params(model_path, vcparams);\n  if (vctx == nullptr) {\n    fprintf(stderr, \"error: Failed to init model as VAD\\n\");\n    return 1;\n  }\n\n  return 0;\n}\n\nint vad(float pcmf32[], size_t pcmf32_len, float **segs_out,\n        size_t *segs_out_len) {\n  if (!whisper_vad_detect_speech(vctx, pcmf32, pcmf32_len)) {\n    fprintf(stderr, \"error: failed to detect speech\\n\");\n    return 1;\n  }\n\n  struct whisper_vad_params params = whisper_vad_default_params();\n  struct whisper_vad_segments *segs =\n      whisper_vad_segments_from_probs(vctx, params);\n  size_t segn = whisper_vad_segments_n_segments(segs);\n\n  // fprintf(stderr, \"Got segments %zd\\n\", segn);\n\n  flat_segs.clear();\n\n  for (int i = 0; i < segn; i++) {\n    flat_segs.push_back(whisper_vad_segments_get_segment_t0(segs, i));\n    flat_segs.push_back(whisper_vad_segments_get_segment_t1(segs, i));\n  }\n\n  // fprintf(stderr, \"setting out variables: %p=%p -> %p, %p=%zx -> %zx\\n\",","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/mudler/LocalAI/blob/44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26/backend/go/whisper/cpp/gowhisper.cpp#L95-L131","documentation":"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.","triggerScenarios":"Thrown at backend/go/whisper/cpp/gowhisper.cpp:113 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26","analyzedAt":"2026-08-15T10:13:50.291Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}