Skip to content

fix(realtime): write committed-utterance WAV header at the session input sample rate - #12749

Open
nexxtmobile wants to merge 2 commits into
mudler:masterfrom
nexxtmobile:fix/realtime-commit-wav-rate
Open

nexxtmobile wants to merge 2 commits into
mudler:masterfrom
nexxtmobile:fix/realtime-commit-wav-rate

Conversation

@nexxtmobile

Copy link
Copy Markdown
Contributor

Fixes #12747

The client-commit path (commitUtteranceWithTranscript) and writeUtteranceWAV
wrote the utterance WAV with a fixed 16 kHz header (laudio.NewWAVHeader),
while the input buffer holds audio at the session input sample rate (e.g.
24 kHz for OpenAI-Realtime clients). The file-based transcription backend
decoded 24 kHz data at 16 kHz (1.5x speed/pitch) → garbage/empty transcripts
→ input_not_committed → total silence after the greeting.

writeUtteranceWAV now takes the sample rate; both call sites pass
session.InputSampleRate (via the existing laudio.NewWAVHeaderWithRate).

Includes a regression spec: the committed WAV header carries the requested
rate (24 kHz and 16 kHz).

Tested: go test -race ./core/http/endpoints/openai/ green (Go 1.26).

@localai-org-maint-bot

Copy link
Copy Markdown
Collaborator

@mudler Code-review sign-off at 7621916df, subject to CI and human DCO certification of the documentation fix. The committed-utterance WAV now uses the session input rate on both file-based transcription paths; all helper callers are updated. I added the required user-facing documentation. Reviewed against master 48f358dd9; whitespace checks pass. Focused endpoint tests were blocked by a dependency-proxy HTTP Forbidden response for LocalAGI; race testing also lacks CGO/a C compiler. No claim that runtime tests passed.

…put sample rate

The client-commit path (commitUtteranceWithTranscript) and writeUtteranceWAV
wrote the utterance WAV with a fixed 16 kHz header (laudio.NewWAVHeader),
but the input buffer holds audio at the session input sample rate (e.g.
24 kHz for OpenAI-Realtime clients). The file-based transcription backend
then decoded 24 kHz data at 16 kHz (1.5x speed/pitch), degrading
transcription to garbage or empty output, which failed the follow-up
response with input_not_committed (total silence after the greeting).

writeUtteranceWAV now takes the sample rate and both call sites pass
session.InputSampleRate (laudio.NewWAVHeaderWithRate already existed).

Regression test: the committed WAV header carries the requested rate.

Signed-off-by: nexxtmobile.de <git@nexxtmobile.de>
@nexxtmobile
nexxtmobile force-pushed the fix/realtime-commit-wav-rate branch from 7621916 to 78b4443 Compare October 19, 2026 13:16
Assisted-by: Codex:gpt-6
Signed-off-by: nexxtmobile.de <git@nexxtmobile.de>
@nexxtmobile

Copy link
Copy Markdown
Contributor Author

Update: rebased onto mudler:master e51747055 (the branch had gone stale / conflicting). go test -race ./core/http/endpoints/openai/ is green on the new base.

Note on the doc commit: a rebase force-push clobbered the maint-bot's doc commit (7621916df). I have re-applied the identical doc change (same file, same text) as 5859326bf with human DCO attestation, per the process used in #12622. Sorry for the churn.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Realtime: committed-utterance WAV written with fixed 16 kHz header breaks 24 kHz client commits (empty STT -> input_not_committed -> total silence)

2 participants