Gemini 3.8 TTS模型現已在AI Gateway上線
Gemini 3.8 text-to-speech models now available on AI Gateway
Gemini 3.8 Flash‑Lite TTS 與 Gemini 3.8 Flash TTS 現已在 AI Gateway 上線,支援 100 多種語言的文本轉語音,支援長篇朗讀、交付控制和雙人對話。
Gemini 3.8 TTS模型已在AI Gateway上線,支援100多種語言、長篇朗讀和雙人對話,開發者可通過AI SDK輕鬆生成語音。
Gemini 3.8 Flash-Lite TTS 和 Gemini 3.8 Flash TTS 來自 Google 現已在 AI Gateway 上提供。
這兩種模型可將文本轉換為超過 100 種語言的語音,並支援長篇敘述、交付控制和雙人對話。
google/gemini-3.8-flash-lite-tts針對高容量語音生成進行了最佳化,提供語調、節奏和逐行交付的控制。google/gemini-3.8-flash-tts針對富有表現力的語音生成和自定義角色設計進行了最佳化,提供表演提示、節奏、口音和對話反應的控制。
要生成語音,請將任一模型 ID 傳遞給 AI SDK(7 或更高版本):
import { generateSpeech } from 'ai';
import { gateway } from '@ai-sdk/gateway';
import { writeFile } from 'node:fs/promises';
const result = await generateSpeech({
model: gateway.speechModel('google/gemini-3.8-flash-lite-tts'),
text: 'Welcome to the audio edition.',
voice: 'Kore',
instructions: 'Warm, relaxed, and speaking slowly',
outputFormat: 'wav',
});
await writeFile('speech.wav', result.audio.uint8Array);
使用 Gemini 3.8 Flash-Lite TTS 生成 WAV 檔案。
在模型演練區嘗試 Flash-Lite TTS 或 Flash TTS。檢視 文本轉語音指南 以獲取設定說明、雙人對話和更多示例。
來源:Vercel Blog · vercel.com