BerriAI/litellm · error · NvidiaRivaException
Audio decode produced no samples.
Error message
Audio decode produced no samples.
What it means
Error "Audio decode produced no samples." thrown in BerriAI/litellm.
Solutions
- Supply a non-empty, valid audio file; the decoded buffer contained zero samples.
When it happens
Trigger: Thrown at litellm/llms/nvidia_riva/audio_transcription/audio_utils.py:140 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/4798931748993b91.
Report an issue: GitHub.
Appendix: source
Thrown at litellm/llms/nvidia_riva/audio_transcription/audio_utils.py:140
),
) from e
# audioread backends (FFmpeg subprocess, GStreamer, Core Audio) require a
# filesystem path, so spill the bytes to a temp file. mkstemp is portable
# to Windows where re-opening a NamedTemporaryFile is not allowed.
fd, tmp_path = tempfile.mkstemp(suffix=".audio")
try:
with os.fdopen(fd, "wb") as tmp_file:
tmp_file.write(file_bytes)
try:
with audioread.audio_open(tmp_path) as src:
source_rate = int(src.samplerate)
channels: Final = int(src.channels)
chunks: Final = []
for buf in src:
chunks.append(np.frombuffer(buf, dtype=np.int16))
if not chunks:
raise NvidiaRivaException(
status_code=400,
message="Audio decode produced no samples.",
)
interleaved = np.concatenate(chunks).astype(np.float32) / 32768.0
if channels > 1:
interleaved = interleaved.reshape(-1, channels)
return cast("FloatArray", interleaved), source_rate
except NvidiaRivaException:
raise
except Exception as e:
raise NvidiaRivaException(
status_code=400,
message=(
"Could not decode audio for Riva STT. Convert your audio to "
f"wav/flac/ogg before calling the API. Underlying error: {e}"
),
) from e
finally:View on GitHub (pinned to 77b7c6c40c)