跳到正文
原文
Simon Willison·· 2026-09-24AI 评分61

Simon Willison 做出支持多说话人对话的 Gemini 3.8 TTS 试验页

Gemini 3.8 TTS Playground

AI 导读

Simon Willison 做出 Gemini 3.8 TTS Playground,可自带 Gemini API key 编写单人旁白或多说话人对话、试听音频,并把设置存成可分享链接。

正文 · AI 翻译

工具 Gemini 3.8 TTS Playground — 通过交互式 playground 测试并体验 Google 的 Gemini 3.8 文本转语音 API,你可以编排单人旁白或多说话人对话,预览生成的音频,并查看请求与响应详情。将编排设置保存为可收藏的 URL 以便轻松分享,并使用你的 Gemini API key 生成高质量语音合成。

Google 今天发布了两款新的 Gemini 文本转语音模型 - gemini-3.8-flash-tts 和 gemini-3.8-flash-lite-tts。

它们配备了超过 2,000 种声音的语音库,还能用“只需一段 30 秒的你自己的声音、或你有权使用的声音的音频样本”创建自定义声音。

我用 GPT-6 Astra 凭感觉写了这个自备密钥的 playground 界面,利用了底层 Gemini API 开放的 CORS 策略。

Screenshot of a web app for composing multi-speaker text-to-speech conversations, with a Compose panel on the left and Connection and Under the hood panels on the right. Left panel: "01 Compose" with a "Load example" button. "Compose settings are saved in the URL for bookmarking or sharing. Your API key is excluded." Toggle with "Single voice" and "Conversation" (Conversation selected). "Cast" section with "+ Add speaker" button. Speaker "Gus", Voice "Puck", with a remove × button. Speaker "Pearl", Voice "Kore", with a remove × button. "Give each speaker a unique name and a voice. Type to search the loaded catalog by voice ID, name, or language." "Dialogue" section with "+ Add line" button. "LINE 01" with up, down and × buttons; Speaker dropdown "Gus"; Delivery style "excited and gossipy"; text "Pearl, have you heard? Half the flock just packed up and moved to the Pacifica pier!" "LINE 02" with up, down and × buttons; Speaker dropdown "Pearl"; Delivery style "calm and unimpressed"; text "I heard. Honestly, Gus, I don't see the appeal. We've got everything we need right here at Pillar Point Harbor." Right panel: "Connection" with a "DIRECT API" badge. "Gemini API key" field showing masked dots with a "Show" button. "2,089 voices loaded. Type in any Voice field to search." "Your key stays in this page's memory and is sent directly to Google. It is never saved to browser storage." "Model" dropdown "gemini-3.8-flash-tts". "Uses your Gemini API account and quota." "Under the hood" panel with an expanded "▼ Request JSON" section showing a JSON code excerpt, a "Copy JSON" button, and an expanded "▼ Response details" section showing a JSON code excerpt.

该 API 的一个显著特点是,它可以轻松定义多个角色之间的完整对话,每个角色都有不同的声音和语音风格指令。

这里有一段简短的演示片段:两只鹈鹕在争论是否应该搬到Pacifica Pier。我让 Claude 4.5 Opus 撰写脚本,并生成一个用该工具渲染它的 URL。

使用 Gemini 3.8 Flash TTS(不是更便宜的 Flash-Lite)生成 1m 18s 的音频花了约 20 秒,费用为 2.74 美分。

来源:Simon Willison · simonwillison.net