Skip to content

server : realtime: reject odd-length audio appends - #31991

Open
T0mSIlver wants to merge 2 commits into
ggml-org:masterfrom
T0mSIlver:realtime-odd-byte-reject
Open

T0mSIlver wants to merge 2 commits into
ggml-org:masterfrom
T0mSIlver:realtime-odd-byte-reject

Conversation

@T0mSIlver

Copy link
Copy Markdown
Contributor

Overview

An input_audio_buffer.append with an odd number of bytes silently drops its last byte. Each append is decoded on its own, so a client that cuts its stream mid-sample gets the following appends decoded one byte off, which gives an empty transcript with Voxtral Realtime.

Both realtime sessions now reject an odd append with an invalid_request_error, so the client is told about the cut instead of getting an empty transcript. The decoding moves to a pcm_s16_to_f32 helper next to pcm_f32_to_s16, which replaces the two copies of the decoding loop and is covered by test-server-component.

With Voxtral Realtime in a transcription session, a 1-byte append followed by 3200-byte appends gave an empty transcript on master; on this branch the 1-byte append gets the error, and whole-sample audio still transcribes. I did not run the conversation path (server-realtime.cpp); it calls the same helper.

Requirements

An input_audio_buffer.append with an odd byte count dropped its last
byte without an error. Both realtime paths now decode with
pcm_s16_to_f32 and send an error for an odd byte count.
@T0mSIlver
T0mSIlver requested a review from a team as a code owner November 10, 2026 01:13
@github-actions github-actions Bot added documentation Improvements or additions to documentation testing Everything test related server labels Nov 10, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation server testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant