mirror of
https://github.com/mudler/LocalAI.git
synced 2026-11-07 04:53:24 -05:00
The committed-utterance WAV is written with a fixed 16 kHz header. The VAD commit path stores audio that is already resampled to 16 kHz (vadCommit), but the client-commit path (input_audio_buffer.commit) passed the raw buffer at the session input rate. For a 24 kHz OpenAI Realtime session the backend decoded 24 kHz audio as 16 kHz (1.5x speed/pitch): garbage or empty transcripts, then input_not_committed on the follow-up response. commitUtterance now resamples from session.InputSampleRate to localSampleRate, so both paths hand 16 kHz audio to the 16 kHz header. This replaces the earlier approach of this PR (header at the session rate), which mislabelled the already-resampled VAD audio (review feedback). Tests go through the real paths with a 24 kHz session: commitUtterance and a server_vad commit via vadTick; both must produce a 16 kHz WAV of the resampled length. The client-commit spec fails without the fix. Fixes #12747 Signed-off-by: nexxtmobile.de <git@nexxtmobile.de> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>