跳到正文
Philipp Schmid· @_philschmid · X·· 2026-09-24精选AI 评分71
AI 导读

Philipp Schmid 发布 Gemini 3.8 Flash TTS 与 Flash-Lite TTS 使用指南,二者已在 Gemini API 和 AI Studio 可用,登顶 Hume's Voice Design Benchmark 并在 Voice Arena 六种语言中居首。

推荐理由

原文给出录制、授权、创建声音和迁移提示词的完整步骤,读者可直接照做复现自定义 TTS 语音。

正文 · 原文

https://x.com/i/article/2103140786292269056

【X 长文】Create your own voice for Gemini 3.8 TTS

Orginally: https://www.philschmid.de/gemini-3-8-tts

Gemini 3.8 Flash TTS and Flash-Lite TTS are now available, in the Gemini API and AI Studio. Ranking #1 on Hume's Voice Design Benchmark, and on top of Voice Arena in 6 languages.

Biggest new features is that you can now replicate your own voice or create a new one from a sentence. The guide below shows how to do both.

Read below or share this prompt with your agent.

1. Record 2 clips

Same mic, same room, 24kHz mono. The API compares the two recordings, so don't switch from a headset to the laptop mic between them.

Linux: -f alsa -i default. On macOS, the first run may only open the microphone permission dialog. Allow it, then run the command again.

The consent sentence must be one of the 25 supported versions, read exactly. German, for example: "Ich bin der Eigentümer dieser Stimme und bin damit einverstanden, dass Google diese Stimme zur Erstellung eines synthetischen Stimmmodells verwendet." The reference clip can be in any language. Use the language you want the voice to speak later.

2. Create the voice, then speak

Two things to notice. The text is spoken word for word. The delivery ("casual, a bit amused") goes in speech_metadata.style, and the short sounds go inline as <short pause> and <laugh>. The voice ID is reusable: pass it in any later request, or find it again with client.voices.list(type_=["replicated"]).

If you don't want anything stored server-side, store=False returns an encrypted voicekey_... that you keep yourself. It works in the same speech_config field and expires after 7 days.

Or design one from a sentence

No recordings needed. Same call, different voice dict. You also get a sample_audio preview, so you can listen to the voice before you synthesize anything:

What changed in prompting

If you're coming from gemini-3.1-flash-tts-preview, this will break your prompts, so read the prompting guide and the migration notes. The short version:

- Input text is spoken word for word. Instructions written inside the text get spoken out loud too.

- Delivery that lasts the whole line ("whispering", "out of breath") goes in speech_metadata.style. Short sounds go inline in angle brackets.

- Multi-speaker turns need an explicit speaker on every turn.

- Long "Audio Profile" prompts now cause voice drift. Design the persona once with the Voices API, then send short or empty style strings.

- Non-streaming (unary) responses are real WAV (audio/wav), so remove any code that adds a WAV header. Set response_format to audio/l16 if you still want raw PCM.

来源:Philipp Schmid · x.com