sgl-project/sglang · error · ValueError

MiniMax H3 audio material has no usable sample rate

Error message

MiniMax H3 audio material has no usable sample rate

What it means

An audio stream's sample_rate parsed but is <= 0 (typically 0 because the field was missing/None). The pipeline needs a positive sample rate for audio materials.

Source

Thrown at python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/material_io.py:454

            ) from exc
        if width <= 0 or height <= 0:
            raise ValueError("MiniMax H3 video material has no positive dimensions")
        fps = _parse_frame_rate(stream.get("avg_frame_rate")) or _parse_frame_rate(
            stream.get("r_frame_rate")
        )
        if fps <= 0:
            raise ValueError("MiniMax H3 video material has no usable frame rate")
        if primary_video is None:
            primary_video = stream

    for stream in audio_streams:
        try:
            sample_rate = int(stream.get("sample_rate") or 0)
            channels = int(stream.get("channels") or 0)
        except (TypeError, ValueError) as exc:
            raise ValueError("MiniMax H3 audio material has invalid metadata") from exc
        if sample_rate <= 0:
            raise ValueError("MiniMax H3 audio material has no usable sample rate")
        if channels <= 0:
            raise ValueError("MiniMax H3 audio material has no usable channel count")

    durations: list[float] = []
    for value in [
        (payload.get("format") or {}).get("duration"),
        *(stream.get("duration") for stream in streams),
    ]:
        if value in {None, "", "N/A"}:
            continue
        try:
            duration = float(value)
        except (TypeError, ValueError):
            continue
        if math.isfinite(duration) and duration > 0:
            durations.append(duration)
    if not durations:
        raise ValueError("MiniMax H3 media material has no positive duration")

View on GitHub (pinned to 0132848349)

Solutions

  1. Re-encode the audio with explicit rate: ffmpeg -i in.wav -ar 44100 out.wav
  2. Fix at the producing side so the audio header carries sample_rate
  3. Validate sample_rate > 0 via ffprobe before submission
Defensive patterns

Strategy: validation

Validate before calling

assert all(int(s.get("sample_rate") or 0) > 0 for s in audio_streams)

Prevention

When it happens

Trigger: Audio streams where ffprobe omits sample_rate or reports 0 — some raw/ADPCM streams or container-muxed audio without a header.

Common situations: PCM-in-MOV without rate metadata, streams produced by experimental muxers, or truncated audio tracks.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/14a824663b597f27. Report an issue: GitHub.