Google Gemini: Gemini 3.1 Flash TTS Preview
Google Gemini 3.1 Flash text-to-speech (preview): powerful, low-latency speech generation with natural outputs, steerable prompts, and expressive audio tags.
プロバイダー
同じモデルを複数のプロバイダーがホストしている場合があります。バックエンドを固定したい場合は1つのプロバイダーを選び、そうでなければルーティングに選択を任せられます。
対応言語
af
sq
am
ar
hy
az
bn
eu
be
bg
my
ca
ceb
cmn
hr
cs
da
nl
en
et
fil
fi
fr
gl
ka
de
el
gu
ht
he
hi
hu
is
id
it
ja
jv
kn
kok
ko
lo
la
lv
lt
lb
mk
mai
mg
ms
ml
mr
mn
ne
nb
nn
or
ps
fa
pl
pt
pa
ro
ru
sr
sd
si
sk
sl
es
sw
sv
ta
te
th
tr
uk
ur
vi
ボイス
機能
Generates spoken audio from text via generateContent (responseModalities AUDIO).
text_to_speech
Streams synthesized audio incrementally over a persistent connection (WebSocket/SSE).
streaming
Synthesizes speech from fully-submitted text in a single synchronous request.
synchronous
Supports 78 documented languages; the model auto-detects the input language (voices are language-agnostic).
multilingual
Supports multi-speaker audio (up to 2 speakers).
multi_speaker
Style, tone, accent, and pace controllable via natural-language prompts.
style_control
コード
ElevenLabs SDKでのストリーミングTTS
ElevenLabs SDKをAllModels経由でルーティングし、音声レスポンスをストリーミングします。
import { ElevenLabsClient } from "elevenlabs";
const client = new ElevenLabsClient({
apiKey: process.env.ALLMODELS_API_KEY,
baseUrl: "https://api.allmodels.io/el"
});
const stream = await client.textToSpeech.stream("voice_id", {
text: "I'm sorry, Dave. I'm afraid I can't do that.",
modelId: "gemini/gemini-3-1-flash-tts-preview",
outputFormat: "mp3_44100_128"
}, {
queryParams: {
provider: {
"only": [
"gemini"
]
}
}
});
const reader = stream.getReader();
for (;;) {
const { done, value } = await reader.read();
if (done) break;
// Write value to your response, file, or audio playback pipeline.
}
