Skip to content

fix(ai): preserve Gemini 3.8 TTS WAV output - #51300

Merged
nexxeln merged 1 commit into
v2from
google-tts-wav
Sep 25, 2026
Merged

nexxeln merged 1 commit into
v2from
google-tts-wav

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

Why

Google's September 22 Gemini 3.8 TTS release changes the unary default from headerless PCM to WAV (audio/wav) with a RIFF header. The Google Speech route already reads the response MIME type, but always attaches info.format: "pcm" and pcm_s16le encoding even when the bytes are WAV. That can make callers wrap a WAV file as if it were raw samples.

What changed

  • Classify Google speech output from the returned MIME type: WAV gets WAV container metadata, while existing PCM responses keep their raw-sample metadata.
  • Reject explicit raw-PCM requests for Gemini 3.8 unary generation before sending, since this route does not select a non-default output format. Do not silently return WAV as requested PCM.
  • Add deterministic fixture-driven tests for WAV classification and both Gemini 3.8 TTS model variants. Existing recorded Google PCM generation/streaming tests remain unchanged.

Checks

  • bun test test/speech.test.ts test/provider/google-speech.recorded.test.ts --timeout 30000 (7 passed)
  • bun typecheck in packages/ai
  • Scoped Prettier and oxlint checks

No provider credentials or live inference were used. This PR does not add a Voices API or change model-catalog metadata.

Requested by: @nexxeln (nexxel via Slack)

@nexxeln
nexxeln merged commit c34ffa1 into v2 Sep 25, 2026
9 of 10 checks passed
@nexxeln
nexxeln deleted the google-tts-wav branch September 25, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant