跳至內容

Gemini 3.1 Flash Tts

整合

模型 id gemini-3.1-flash-tts
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/gemini-3.1-flash-tts?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Hello from Doitong. This is a short test sentence."
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

此請求: $0.003 3 API 點數 在此頁面執行

取得 API 金鑰
Google 文字轉語音 唇形同步快速 #lipsync#avatar

Gemini 3.1 Flash 文字轉語音,支援內嵌風格控制、30 種語音和最多 10 位說話者

Google · 音訊

您的第一個結果會顯示在這裡

在下方建立請求,並使用您的 API 金鑰執行。輸出會複製到我們的儲存空間,可永久保留或免費保留 7 天。

建立請求

控制項是根據模型結構描述生成的。變更設定時,程式碼和價格會同步更新。

•必填 50 / 50000

Gemini 3.1 Flash TTS 的語音合成文字;多說話者行必須以 speakers 欄位中的別名開頭,例如 'Alice: Hello!\nBob: Hi!'。可使用 [sigh]、[laughing]、[whispering] 和 [short pause] 等表達音訊標籤,或使用內嵌自然語言指示控制口音、情緒、語速與風格,例如 'Say cheerfully: Have a wonderful day!'。

進階 style_instructions · output_format · voice · language_code · temperature · speakers
0 / 4000

與口述內容分開保留、並插入提示詞前方以塑造表達力、口音、語速、語調和情緒的可選自然語言指示。範例包括 'Speak warmly and slowly'、'Read this as a dramatic newscast'、'Use a British accent with a cheerful tone' 和 'Whisper mysteriously'。

output_format 預設 mp3

輸出音訊格式:mp3 提供壓縮且精簡的檔案,建議使用;wav 在 WAV 容器中包含 24 kHz、16 位元單聲道的未壓縮 PCM 音訊;ogg_opus 在 Ogg 中使用 Opus,兼顧品質與大小。

預設 Kore

從 30 種不同預設中選取單一說話者的聲音;設定 speakers 後,此選擇會停用。熱門女性選項包括 Kore(強勁堅定)、Zephyr(明亮清晰)和 Aoede(溫暖旋律);熱門男性選項包括 Puck(活潑有朝氣)和 Charon(沉穩專業)。

多語言合成語言覆寫:除非指定語言引導模型的語音,否則會自動從文字偵測。

預設 1

語音隨機性設定;較低設定產生集中且可預測的語音,較高設定產生創意且多變的語音。

啟用多位說話者朗讀不同文字段落的語音設定。為每位說話者指定聲音及與提示詞前綴相符的 speaker_id 別名。

POST /run/gemini-3.1-flash-tts?wait=20 報價 → $0.003
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/gemini-3.1-flash-tts?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Hello from Doitong. This is a short test sentence."
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

執行此請求

您的金鑰會保留在此瀏覽器中:只會傳送至 Doitong API,且只有在勾選「記住」時才會儲存至 localStorage。 取得 API 金鑰

關於 Gemini 3.1 Flash Tts

將最多 50000 個字元的 `prompt` 轉為語音。可透過內嵌指示或 `style_instructions` 控制語氣。可選擇 30 種語音、設定 `language_code`,或使用 `speakers`(2 到 10 位)生成多說話者音訊。輸出格式為 mp3、wav 或 ogg_opus,`temperature` 範圍為 0 到 2。

參數

名稱類型 預設值允許值 說明
prompt必填
類型string
≤ 50,000 個字元
Gemini 3.1 Flash TTS 的語音合成文字;多說話者行必須以 speakers 欄位中的別名開頭,例如 'Alice: Hello!\nBob: Hi!'。可使用 [sigh]、[laughing]、[whispering] 和 [short pause] 等表達音訊標籤,或使用內嵌自然語言指示控制口音、情緒、語速與風格,例如 'Say cheerfully: Have a wonderful day!'。
style_instructions選填
類型string | null
≤ 4,000 個字元
與口述內容分開保留、並插入提示詞前方以塑造表達力、口音、語速、語調和情緒的可選自然語言指示。範例包括 'Speak warmly and slowly'、'Read this as a dramatic newscast'、'Use a British accent with a cheerful tone' 和 'Whisper mysteriously'。
voice選填
類型enum
預設值Kore
AchernarAchirdAlgenibAlgiebaAlnilamAoedeAutonoeCallirrhoeCharonDespinaEnceladusErinomeFenrirGacruxIapetusKore
另有 14 個LaomedeiaLedaOrusPulcherrimaPuckRasalgethiSadachbiaSadaltagerSchedarSulafatUmbrielVindemiatrixZephyrZubenelgenubi
從 30 種不同預設中選取單一說話者的聲音;設定 speakers 後,此選擇會停用。熱門女性選項包括 Kore(強勁堅定)、Zephyr(明亮清晰)和 Aoede(溫暖旋律);熱門男性選項包括 Puck(活潑有朝氣)和 Charon(沉穩專業)。
language_code選填
類型enum
Arabic (Egypt)Bangla (Bangladesh)Dutch (Netherlands)English (India)English (US)French (France)German (Germany)Hindi (India)Indonesian (Indonesia)Italian (Italy)Japanese (Japan)Korean (South Korea)Marathi (India)Polish (Poland)Portuguese (Brazil)Romanian (Romania)
另有 71 個Russian (Russia)Spanish (Spain)Tamil (India)Telugu (India)Thai (Thailand)Turkish (Turkey)Ukrainian (Ukraine)Vietnamese (Vietnam)Afrikaans (South Africa)Albanian (Albania)Amharic (Ethiopia)Arabic (World)Armenian (Armenia)Azerbaijani (Azerbaijan)Basque (Spain)Belarusian (Belarus)Bulgarian (Bulgaria)Burmese (Myanmar)Catalan (Spain)Cebuano (Philippines)Chinese Mandarin (China)Chinese Mandarin (Taiwan)Croatian (Croatia)Czech (Czech Republic)Danish (Denmark)English (Australia)English (UK)Estonian (Estonia)Filipino (Philippines)Finnish (Finland)French (Canada)Galician (Spain)Georgian (Georgia)Greek (Greece)Gujarati (India)Haitian Creole (Haiti)Hebrew (Israel)Hungarian (Hungary)Icelandic (Iceland)Javanese (Java)Kannada (India)Konkani (India)Lao (Laos)Latin (Vatican City)Latvian (Latvia)Lithuanian (Lithuania)Luxembourgish (Luxembourg)Macedonian (North Macedonia)Maithili (India)Malagasy (Madagascar)Malay (Malaysia)Malayalam (India)Mongolian (Mongolia)Nepali (Nepal)Norwegian Bokmal (Norway)Norwegian Nynorsk (Norway)Odia (India)Pashto (Afghanistan)Persian (Iran)Portuguese (Portugal)Punjabi (India)Serbian (Serbia)Sindhi (India)Sinhala (Sri Lanka)Slovak (Slovakia)Slovenian (Slovenia)Spanish (Latin America)Spanish (Mexico)Swahili (Kenya)Swedish (Sweden)Urdu (Pakistan)
多語言合成語言覆寫:除非指定語言引導模型的語音,否則會自動從文字偵測。
speakers選填
類型object[]
啟用多位說話者朗讀不同文字段落的語音設定。為每位說話者指定聲音及與提示詞前綴相符的 speaker_id 別名。
temperature選填
類型number
預設值1
0 – 2
語音隨機性設定;較低設定產生集中且可預測的語音,較高設定產生創意且多變的語音。
output_format選填
類型enum
預設值mp3
wavmp3ogg_opus
輸出音訊格式:mp3 提供壓縮且精簡的檔案,建議使用;wav 在 WAV 容器中包含 24 kHz、16 位元單聲道的未壓縮 PCM 音訊;ogg_opus 在 Ogg 中使用 Opus,兼顧品質與大小。
必填

輸出

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "gemini-3.1-flash-tts",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 3,
    "usd": "0.003",
    "charged": 3,
    "refunded": 0
  },
  "input": {
    "prompt": "Hello from Doitong. This is a short test sentence."
  },
  "output": {
    "audio": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp3",
      "content_type": "audio/mpeg",
      "file_name": "0-output.mp3",
      "file_size": 1843200
    }
  },
  "outputs": [
    {
      "type": "audio",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp3",
      "content_type": "audio/mpeg",
      "file_size": 1843200,
      "duration": 12,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
您的檔案,由您選擇每個 outputs[].url 都是儲存空間中的副本:可永久保留(按 GB-月計費),或免費保留 7 天;可透過帳戶設定或 ?storage= 設定。
所有模型使用相同結構圖片、影片和音訊皆包含 type、url、content_type、width、height 和 duration。output 是模型自己的結果物件。
輸出欄位
audio
object {url, content_type, file_name, file_size}生成產生的音訊檔案。

給 AI 代理程式:此頁面的 Markdown 位於 https://doitong.com/zh-TW/developers/models/gemini-3.1-flash-tts.md. 所有模型與指南: https://doitong.com/developers/llms.txt