靈活的參數
可設定 3 個已記錄的參數,包括 duration_seconds, output_format, text。
curl -X POST https://runapi.ai/api/v1/elevenlabs/text_to_sound \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sound-effect-v2",
"text": "將這段文字轉換為自然語音,使用溫暖的英式男聲,語速適中。"
}'
import { ElevenlabsClient } from "@runapi.ai/elevenlabs";
const client = new ElevenlabsClient();
const result = await client.textToSound.run({
model: "sound-effect-v2",
text: "將這段文字轉換為自然語音,使用溫暖的英式男聲,語速適中。",
});
import os
import requests
response = requests.post(
"https://runapi.ai/api/v1/elevenlabs/text_to_sound",
headers={"Authorization": f"Bearer {os.environ['RUNAPI_API_KEY']}"},
json={"model":"sound-effect-v2","text":"將這段文字轉換為自然語音,使用溫暖的英式男聲,語速適中。"}
)
response.raise_for_status()
<?php
$client = curl_init("https://runapi.ai/api/v1/elevenlabs/text_to_sound");
curl_setopt_array($client, [
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("RUNAPI_API_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
'model' => 'sound-effect-v2',
'text' => '將這段文字轉換為自然語音,使用溫暖的英式男聲,語速適中。',
])
]);
$response = curl_exec($client);
RunApi client = new RunApi(System.getenv("RUNAPI_API_KEY"));
Task task = client.textToSound().run({"model":"sound-effect-v2","text":"將這段文字轉換為自然語音,使用溫暖的英式男聲,語速適中。"});
task.waitForResult();
require "runapi/elevenlabs"
client = RunApi::Elevenlabs::Client.new
result = client.text_to_sound.run(
model: "sound-effect-v2",
text: "將這段文字轉換為自然語音,使用溫暖的英式男聲,語速適中。"
)
client := runapi.NewClient(os.Getenv("RUNAPI_API_KEY"))
task, err := client.textToSound.Run({"model":"sound-effect-v2","text":"將這段文字轉換為自然語音,使用溫暖的英式男聲,語速適中。"})
if err != nil { log.Fatal(err) }
task.Wait()
$ runapi generate \
--model sound-effect-v2 \
--endpoint text_to_sound \
--wait
6 個版本可用
| 提供者 | ElevenLabs |
| 模型 ID | sound-effect-v2 |
| 模態 | 音訊與音樂 |
| 任務類型 | Asynchronous |
| API 端點 | /api/v1/elevenlabs/text_to_sound |
| 計費單位 | 分鐘 |
| 輸入參數 | duration_seconds, output_format, text |
| 輸出格式 | mp3_22050_32, mp3_44100_32, mp3_44100_64, mp3_44100_96, mp3_44100_128, mp3_44100_192, pcm_8000, pcm_16000, pcm_22050, pcm_24000, pcm_44100, pcm_48000, ulaw_8000, alaw_8000, opus_48000_32, opus_48000_64, opus_48000_96, opus_48000_128, opus_48000_192 |
| 目錄狀態 | 已下線 |
免費註冊後,在控制台建立 sound-effect-v2 的 API 金鑰。
向 /api/v1/elevenlabs/text_to_sound 發送 POST 請求,並傳入 sound-effect-v2 模型 ID 和參數。
輪詢工作或按照回呼取得已完成的 sound-effect-v2 結果。
可設定 3 個已記錄的參數,包括 duration_seconds, output_format, text。
開放 1 個公開 endpoint:text_to_sound。
按 分鐘 計量,無需訂閱。
text暫無描述。
output_format暫無描述。 (mp3_22050_32, mp3_44100_32, mp3_44100_64, mp3_44100_96, mp3_44100_128, mp3_44100_192, pcm_8000, pcm_16000, pcm_22050, pcm_24000, pcm_44100, pcm_48000, ulaw_8000, alaw_8000, opus_48000_32, opus_48000_64, opus_48000_96, opus_48000_128, opus_48000_192)
duration_seconds暫無描述。
生成同集數氛圍匹配的免版稅背景音樂,無需付授權費。
為程序生成關卡製作可自適應的環境音景同音效。
無需錄音室,都可以為客戶廣告生成自訂旁白同音效。
傳入 quickstart 顯示嘅 model ID。
每個 key 的 rate limit 會按使用層級而定。請查看定價頁了解最新限制。
可以——variant 只係一個旗標。只要更改 model 參數就可以切換。
在可用 streaming 的情況下,RunAPI 會端到端串流。
可以在公開 GitHub repo 開 issue,或者電郵支援團隊。
不需要。你的 RunAPI API key 足以存取此 variant 及目錄中的所有其他模型,無需底層供應商帳戶。