insight Simon Willison 2026-09-15T22:47 正文 ok 117 words

Gemini Live 音频

英文标题:Gemini Live audio

Google 发布了 Gemini 3.8 Live 和 Gemini 3.8 Live Extended Thinking 两款语音到语音模型,其产品形态与 OpenAI 的 GPT-Live 系列相近。作者让 GPT-6 Astra Extra High 根据文档构建了一个浏览器端 Web UI,可选择模型和语音预设、设置系统提示词,并进行可随时打断模型的实时语音对话。该实现不依赖第三方库,直接通过 WebSocket 连接 Gemini API,并使用 Web Audio API 完成音频采集和播放,为开发者提供了一个简洁的 Live API 接入示例。
打开原文相关 2.4 · 机会 1
media79.7 KB

中文

Google 今天发布了 Gemini 3.8 Live 和 Gemini 3.8 Live Extended Thinking——两款语音到语音模型,其产品形态与 OpenAI 的 GPT-Live 系列相似。

我让 GPT-6 Astra Extra High 参考相关文档,为我构建了这个 Web UI,用于试用这些新模型。你可以选择模型和语音预设,输入可选的系统提示词,然后通过浏览器开始语音对话;它还支持在模型说话时打断其回复。

带有转录文本的语音聊天 Web 界面截图。顶部按钮包括:Start session、End session、Mute mic,另有 Mic level 音量表以及显示 0:33 的计时器。状态为 Listening。提示使用耳机以减少回声。启动会话时将请求麦克风访问权限。Transcript 区域带有 Download transcript 和 Clear 按钮。Gemini:是的,运行得很完美。我可以清楚地听到你。今天我能如何帮助你?你:好的,这相当不错。告诉我一些关于加州褐鹈鹕的有趣事实。Gemini:它们以捕捉鱼类时壮观的俯冲而闻名,并且拥有巨大的喉囊,最多可容纳三加仑的水和鱼。它们在濒危后也实现了显著恢复——标记为 Interrupted。你:不,实际上请告诉我不同的事实。Gemini:它们会在近海岛屿上群体筑巢,喉囊中最多可容纳三加仑的水。底部是一个写着 Or type a message… 的文本输入框,以及 Send 按钮,并注明:发送消息会中断当前回复。转录内容可能包含在播放前被中断的语音。

这一实现没有使用任何库。它连接到 wss://generativelanguage.googleapis.com/ws/google.ai.generativelanguage.v1alpha.GenerativeService.BidiGenerateContent?key=... WebSocket 端点,并使用 Web Audio API 的 AudioContext 同时进行音频采集和播放。

以下是用于开始使用该 WebSockets API 的 Gemini Live 教程。

English / 原文

Google released Gemini 3.8 Live and 3.8 Live Extended Thinking today - two new speech-to-speech models that are a similar shape to OpenAI's GPT-Live family.

I pointed GPT-6 Astra Extra High at the documentation and had it build me this web UI for trying out the new models. You can select a model and voice preset, enter an optional system prompt and then start a voice conversation through your browser, including the ability to interrupt the model while it is talking.

Screenshot of a voice chat web interface with a transcript. Top buttons: Start session, End session, Mute mic, plus a Mic level meter and a timer showing 0:33. Status: Listening. Use headphones to reduce echo. Starting a session asks for microphone access. Transcript (with Download transcript and Clear buttons). Gemini: Yes, it's working perfectly. I can hear you clearly. How can I help you today? You: Okay, this is pretty good. Tell me some interesting facts about the California brown pelican. Gemini: They're famous for their spectacular plunge-dives to catch fish and have huge throat pouches that can hold up to three gallons of water and fish. They also made a great recovery after being endangered — marked as Interrupted. You: No, tell me different facts actually. Gemini: They nest in colonies on offshore islands and can hold up to three gallons of water in their throat pouches. At the bottom is a text input reading Or type a message… with a Send button, and the note: Sending a message interrupts the current response. Transcripts may include speech interrupted before playback.

The implementation uses no libraries. It connects to the wss://generativelanguage.googleapis.com/ws/google.ai.generativelanguage.v1alpha.GenerativeService.BidiGenerateContent?key=... WebSocket endpoint and uses a Web Audio API AudioContext for both capture and playback.

Here's the Gemini Live tutorial for getting started with that WebSockets API.