Skip to content

feat(google): add Gemini 3.1 Flash TTS support#1820

Open
rosetta-livekit-bot[bot] wants to merge 1 commit into
1.5.0from
port-gemini-31-flash-tts
Open

feat(google): add Gemini 3.1 Flash TTS support#1820
rosetta-livekit-bot[bot] wants to merge 1 commit into
1.5.0from
port-gemini-31-flash-tts

Conversation

@rosetta-livekit-bot

@rosetta-livekit-bot rosetta-livekit-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Testing

  • pnpm test plugins/google/src/beta/gemini_tts.test.ts
  • pnpm --filter @livekit/agents-plugin-google build
  • pnpm build:plugins
  • pnpm --filter livekit-agents-examples build

Ported from livekit/agents#6134

Original PR description

…handling, and include new examples and tests.

@changeset-bot

changeset-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0835a48

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 35 packages
Name Type
@livekit/agents-plugin-google Patch
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-assemblyai Patch
@livekit/agents-plugin-baseten Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-cerebras Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-did Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-fishaudio Patch
@livekit/agents-plugin-hedra Patch
@livekit/agents-plugin-hume Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-lemonslice Patch
@livekit/agents-plugin-liveavatar Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-minimax Patch
@livekit/agents-plugin-mistral Patch
@livekit/agents-plugin-mistralai Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-perplexity Patch
@livekit/agents-plugin-phonic Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-runway Patch
@livekit/agents-plugin-sarvam Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugin-soniox Patch
@livekit/agents-plugin-tavus Patch
@livekit/agents-plugin-trugen Patch
@livekit/agents-plugin-xai Patch
@livekit/agents-plugins-test Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

Comment on lines +263 to +266
for (const frame of bstream.flush()) {
sendLastFrame(false);
lastFrame = frame;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 AudioByteStream.flush() produces 0-sample frame when buffer is empty

When all audio data aligns perfectly with the AudioByteStream frame size (bytesPerFrame = 4800 bytes for 24kHz mono at 100ms), the internal buffer is empty at flush time. AudioByteStream.flush() at agents/src/audio.ts:76-93 doesn't guard against an empty buffer — it always returns an array with one frame, even if that frame has 0 samples. This 0-sample frame becomes lastFrame and is emitted as the final: true frame. The resemble plugin guards against this (plugins/resemble/src/tts.ts:155: if (frame.samplesPerChannel === 0) continue), but most other plugins don't. This is a pre-existing issue not introduced by this PR — the old Gemini code had the same exposure.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

0 participants