mudler/LocalAI · info

Audio clip not playable — it was truncated when recorded (ra

Error message

Audio clip not playable — it was truncated when recorded (raise Max Body Bytes in the tracing settings).

What it means

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.

Source

Thrown at core/http/react-ui/src/pages/Traces.jsx:168

  const metrics = [
    { label: 'Duration', value: data.audio_duration_s + 's' },
    { label: 'Sample Rate', value: data.audio_sample_rate + ' Hz' },
    { label: 'RMS Level', value: data.audio_rms_dbfs + ' dBFS' },
    { label: 'Peak Level', value: data.audio_peak_dbfs + ' dBFS' },
    { label: 'Samples', value: data.audio_samples },
    { label: 'Snippet', value: data.audio_snippet_s + 's' },
    { label: 'DC Offset', value: data.audio_dc_offset },
  ]
  return (
    <div className="mb-md">
      <h4 className="hstack hstack--xs text-sm fw-semibold mb-xs">
        <i className="fas fa-headphones text-primary" /> Audio Snippet
      </h4>
      <div className="tr-well">
        {audioUrl
          ? <WaveformPlayer src={audioUrl} height={64} />
          : <div data-testid="audio-snippet-unavailable" className="text-xs text-secondary pad-xs">
              <i className="fas fa-triangle-exclamation" /> Audio clip not playable — it was truncated when recorded (raise Max Body Bytes in the tracing settings).
            </div>}
        <div className="tr-metrics mt-sm">
          {metrics.map(m => (
            <div key={m.label} className="tr-metric">
              <div className="text-secondary">{m.label}</div>
              <div className="text-mono">{m.value}</div>
            </div>
          ))}
        </div>
      </div>
    </div>
  )
}

function isPlainObject(value) {
  return value !== null && typeof value === 'object' && !Array.isArray(value)
}

View on GitHub (pinned to 44413a9d06)

Solutions

  1. Open the tracing settings and raise Max Body Bytes so full audio bodies fit within the capture budget.
  2. Reproduce the request after the limit change — only newly recorded traces will have playable audio; old truncated traces stay unplayable.
  3. If storage cost matters, raise the limit only for TTS endpoints or temporarily while debugging, then lower it again.
  4. Use the numeric metrics shown alongside (snippet seconds, DC offset) for diagnosis when the clip itself is unavailable.

Example fix

Settings -> Tracing: Max Body Bytes
// before: 1 MB   -> long TTS responses truncated, snippet unplayable
// after:  16 MB  -> full audio body captured, WaveformPlayer renders
Defensive patterns

Strategy: fallback

Validate before calling

// Traces.jsx — derive audioUrl only when the body was fully captured
const audioUrl = data.audio_captured_bytes != null &&
                 data.audio_captured_bytes <= tracingMaxBodyBytes
  ? buildAudioUrl(data) : null

Type guard

const hasPlayableAudio = (data) =>
  Boolean(data.audioUrl) && data.truncated !== true;

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of mudler/LocalAI@44413a9d06 (2026-08-15). Data as JSON: /api/errors/8d494abd033bab15. Report an issue: GitHub.