{"record":{"id":"8d494abd033bab15","repo":"mudler/LocalAI","slug":"audio-clip-not-playable-it-was-truncated-when-re","errorCode":null,"errorMessage":"Audio clip not playable — it was truncated when recorded (raise Max Body Bytes in the tracing settings).","messagePattern":"Audio clip not playable — it was truncated when recorded \\(raise Max Body Bytes in the tracing settings\\)\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"core/http/react-ui/src/pages/Traces.jsx","lineNumber":168,"sourceCode":"  const metrics = [\n    { label: 'Duration', value: data.audio_duration_s + 's' },\n    { label: 'Sample Rate', value: data.audio_sample_rate + ' Hz' },\n    { label: 'RMS Level', value: data.audio_rms_dbfs + ' dBFS' },\n    { label: 'Peak Level', value: data.audio_peak_dbfs + ' dBFS' },\n    { label: 'Samples', value: data.audio_samples },\n    { label: 'Snippet', value: data.audio_snippet_s + 's' },\n    { label: 'DC Offset', value: data.audio_dc_offset },\n  ]\n  return (\n    <div className=\"mb-md\">\n      <h4 className=\"hstack hstack--xs text-sm fw-semibold mb-xs\">\n        <i className=\"fas fa-headphones text-primary\" /> Audio Snippet\n      </h4>\n      <div className=\"tr-well\">\n        {audioUrl\n          ? <WaveformPlayer src={audioUrl} height={64} />\n          : <div data-testid=\"audio-snippet-unavailable\" className=\"text-xs text-secondary pad-xs\">\n              <i className=\"fas fa-triangle-exclamation\" /> Audio clip not playable — it was truncated when recorded (raise Max Body Bytes in the tracing settings).\n            </div>}\n        <div className=\"tr-metrics mt-sm\">\n          {metrics.map(m => (\n            <div key={m.label} className=\"tr-metric\">\n              <div className=\"text-secondary\">{m.label}</div>\n              <div className=\"text-mono\">{m.value}</div>\n            </div>\n          ))}\n        </div>\n      </div>\n    </div>\n  )\n}\n\nfunction isPlainObject(value) {\n  return value !== null && typeof value === 'object' && !Array.isArray(value)\n}\n","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/mudler/LocalAI/blob/44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26/core/http/react-ui/src/pages/Traces.jsx#L150-L186","documentation":"React UI informational notice on the Traces page: an audio snippet exists for the traced request but audioUrl is falsy, so WaveformPlayer cannot render it. The tracing subsystem only captured part of the response body (it stopped at the configured Max Body Bytes limit), which truncates the recorded audio and makes the clip unplayable, so the UI deliberately shows 'not playable' instead of a broken player.","triggerScenarios":"Opening a trace whose span has audio metrics (audio_snippet_s, audio_dc_offset) but no playable audioUrl — i.e. the audio response exceeded the tracing Max Body Bytes capture limit and was stored truncated; the audioUrl ? branch is skipped and the warning div (data-testid audio-snippet-unavailable) renders.","commonSituations":"TTS/speech backends returning long clips (tens of seconds of WAV) with default tracing body limits; production deployments lowering Max Body Bytes to control trace storage; investigating a TTS latency trace and expecting to hear the audio.","solutions":["Open the tracing settings and raise Max Body Bytes so full audio bodies fit within the capture budget.","Reproduce the request after the limit change — only newly recorded traces will have playable audio; old truncated traces stay unplayable.","If storage cost matters, raise the limit only for TTS endpoints or temporarily while debugging, then lower it again.","Use the numeric metrics shown alongside (snippet seconds, DC offset) for diagnosis when the clip itself is unavailable."],"exampleFix":"Settings -> Tracing: Max Body Bytes\n// before: 1 MB   -> long TTS responses truncated, snippet unplayable\n// after:  16 MB  -> full audio body captured, WaveformPlayer renders","handlingStrategy":"fallback","validationCode":"// Traces.jsx — derive audioUrl only when the body was fully captured\nconst audioUrl = data.audio_captured_bytes != null &&\n                 data.audio_captured_bytes <= tracingMaxBodyBytes\n  ? buildAudioUrl(data) : null","typeGuard":"const hasPlayableAudio = (data) =>\n  Boolean(data.audioUrl) && data.truncated !== true;","tryCatchPattern":null,"preventionTips":["Raise tracing Max Body Bytes above your longest TTS response size before recording traces you need audio for.","Remember traces recorded under the old limit stay unplayable; re-record after changing settings.","When audio is unavailable, fall back to the numeric snippet metrics (duration, DC offset) shown in the same panel."],"tags":["react","tracing","ui","tts","audio","configuration"],"backgroundTag":null,"analyzedSha":"44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26","analyzedAt":"2026-08-15T10:13:50.291Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}