ElevenLabs テキスト読み上げ V3
curl --request POST \
--url https://api.highwayapi.ai/v3/elevenlabs-tts-v3 \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"seed": 123,
"text": "<string>",
"stream": true,
"voice_id": "<string>",
"language_code": "<string>",
"output_format": "<string>",
"use_pvc_as_ivc": true,
"voice_settings": {
"speed": 123,
"style": 123,
"stability": 123,
"similarity_boost": 123,
"use_speaker_boost": true
},
"apply_text_normalization": "<string>",
"apply_language_text_normalization": true,
"pronunciation_dictionary_locators": [
{
"version_id": "<string>",
"pronunciation_dictionary_id": "<string>"
}
]
}
'import requests
url = "https://api.highwayapi.ai/v3/elevenlabs-tts-v3"
payload = {
"seed": 123,
"text": "<string>",
"stream": True,
"voice_id": "<string>",
"language_code": "<string>",
"output_format": "<string>",
"use_pvc_as_ivc": True,
"voice_settings": {
"speed": 123,
"style": 123,
"stability": 123,
"similarity_boost": 123,
"use_speaker_boost": True
},
"apply_text_normalization": "<string>",
"apply_language_text_normalization": True,
"pronunciation_dictionary_locators": [
{
"version_id": "<string>",
"pronunciation_dictionary_id": "<string>"
}
]
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
seed: 123,
text: '<string>',
stream: true,
voice_id: '<string>',
language_code: '<string>',
output_format: '<string>',
use_pvc_as_ivc: true,
voice_settings: {
speed: 123,
style: 123,
stability: 123,
similarity_boost: 123,
use_speaker_boost: true
},
apply_text_normalization: '<string>',
apply_language_text_normalization: true,
pronunciation_dictionary_locators: [{version_id: '<string>', pronunciation_dictionary_id: '<string>'}]
})
};
fetch('https://api.highwayapi.ai/v3/elevenlabs-tts-v3', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.highwayapi.ai/v3/elevenlabs-tts-v3",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'seed' => 123,
'text' => '<string>',
'stream' => true,
'voice_id' => '<string>',
'language_code' => '<string>',
'output_format' => '<string>',
'use_pvc_as_ivc' => true,
'voice_settings' => [
'speed' => 123,
'style' => 123,
'stability' => 123,
'similarity_boost' => 123,
'use_speaker_boost' => true
],
'apply_text_normalization' => '<string>',
'apply_language_text_normalization' => true,
'pronunciation_dictionary_locators' => [
[
'version_id' => '<string>',
'pronunciation_dictionary_id' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.highwayapi.ai/v3/elevenlabs-tts-v3"
payload := strings.NewReader("{\n \"seed\": 123,\n \"text\": \"<string>\",\n \"stream\": true,\n \"voice_id\": \"<string>\",\n \"language_code\": \"<string>\",\n \"output_format\": \"<string>\",\n \"use_pvc_as_ivc\": true,\n \"voice_settings\": {\n \"speed\": 123,\n \"style\": 123,\n \"stability\": 123,\n \"similarity_boost\": 123,\n \"use_speaker_boost\": true\n },\n \"apply_text_normalization\": \"<string>\",\n \"apply_language_text_normalization\": true,\n \"pronunciation_dictionary_locators\": [\n {\n \"version_id\": \"<string>\",\n \"pronunciation_dictionary_id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.highwayapi.ai/v3/elevenlabs-tts-v3")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"seed\": 123,\n \"text\": \"<string>\",\n \"stream\": true,\n \"voice_id\": \"<string>\",\n \"language_code\": \"<string>\",\n \"output_format\": \"<string>\",\n \"use_pvc_as_ivc\": true,\n \"voice_settings\": {\n \"speed\": 123,\n \"style\": 123,\n \"stability\": 123,\n \"similarity_boost\": 123,\n \"use_speaker_boost\": true\n },\n \"apply_text_normalization\": \"<string>\",\n \"apply_language_text_normalization\": true,\n \"pronunciation_dictionary_locators\": [\n {\n \"version_id\": \"<string>\",\n \"pronunciation_dictionary_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/elevenlabs-tts-v3")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"seed\": 123,\n \"text\": \"<string>\",\n \"stream\": true,\n \"voice_id\": \"<string>\",\n \"language_code\": \"<string>\",\n \"output_format\": \"<string>\",\n \"use_pvc_as_ivc\": true,\n \"voice_settings\": {\n \"speed\": 123,\n \"style\": 123,\n \"stability\": 123,\n \"similarity_boost\": 123,\n \"use_speaker_boost\": true\n },\n \"apply_text_normalization\": \"<string>\",\n \"apply_language_text_normalization\": true,\n \"pronunciation_dictionary_locators\": [\n {\n \"version_id\": \"<string>\",\n \"pronunciation_dictionary_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body音声
ElevenLabs テキスト読み上げ V3
POST
/
v3
/
elevenlabs-tts-v3
ElevenLabs テキスト読み上げ V3
curl --request POST \
--url https://api.highwayapi.ai/v3/elevenlabs-tts-v3 \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"seed": 123,
"text": "<string>",
"stream": true,
"voice_id": "<string>",
"language_code": "<string>",
"output_format": "<string>",
"use_pvc_as_ivc": true,
"voice_settings": {
"speed": 123,
"style": 123,
"stability": 123,
"similarity_boost": 123,
"use_speaker_boost": true
},
"apply_text_normalization": "<string>",
"apply_language_text_normalization": true,
"pronunciation_dictionary_locators": [
{
"version_id": "<string>",
"pronunciation_dictionary_id": "<string>"
}
]
}
'import requests
url = "https://api.highwayapi.ai/v3/elevenlabs-tts-v3"
payload = {
"seed": 123,
"text": "<string>",
"stream": True,
"voice_id": "<string>",
"language_code": "<string>",
"output_format": "<string>",
"use_pvc_as_ivc": True,
"voice_settings": {
"speed": 123,
"style": 123,
"stability": 123,
"similarity_boost": 123,
"use_speaker_boost": True
},
"apply_text_normalization": "<string>",
"apply_language_text_normalization": True,
"pronunciation_dictionary_locators": [
{
"version_id": "<string>",
"pronunciation_dictionary_id": "<string>"
}
]
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
seed: 123,
text: '<string>',
stream: true,
voice_id: '<string>',
language_code: '<string>',
output_format: '<string>',
use_pvc_as_ivc: true,
voice_settings: {
speed: 123,
style: 123,
stability: 123,
similarity_boost: 123,
use_speaker_boost: true
},
apply_text_normalization: '<string>',
apply_language_text_normalization: true,
pronunciation_dictionary_locators: [{version_id: '<string>', pronunciation_dictionary_id: '<string>'}]
})
};
fetch('https://api.highwayapi.ai/v3/elevenlabs-tts-v3', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.highwayapi.ai/v3/elevenlabs-tts-v3",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'seed' => 123,
'text' => '<string>',
'stream' => true,
'voice_id' => '<string>',
'language_code' => '<string>',
'output_format' => '<string>',
'use_pvc_as_ivc' => true,
'voice_settings' => [
'speed' => 123,
'style' => 123,
'stability' => 123,
'similarity_boost' => 123,
'use_speaker_boost' => true
],
'apply_text_normalization' => '<string>',
'apply_language_text_normalization' => true,
'pronunciation_dictionary_locators' => [
[
'version_id' => '<string>',
'pronunciation_dictionary_id' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.highwayapi.ai/v3/elevenlabs-tts-v3"
payload := strings.NewReader("{\n \"seed\": 123,\n \"text\": \"<string>\",\n \"stream\": true,\n \"voice_id\": \"<string>\",\n \"language_code\": \"<string>\",\n \"output_format\": \"<string>\",\n \"use_pvc_as_ivc\": true,\n \"voice_settings\": {\n \"speed\": 123,\n \"style\": 123,\n \"stability\": 123,\n \"similarity_boost\": 123,\n \"use_speaker_boost\": true\n },\n \"apply_text_normalization\": \"<string>\",\n \"apply_language_text_normalization\": true,\n \"pronunciation_dictionary_locators\": [\n {\n \"version_id\": \"<string>\",\n \"pronunciation_dictionary_id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.highwayapi.ai/v3/elevenlabs-tts-v3")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"seed\": 123,\n \"text\": \"<string>\",\n \"stream\": true,\n \"voice_id\": \"<string>\",\n \"language_code\": \"<string>\",\n \"output_format\": \"<string>\",\n \"use_pvc_as_ivc\": true,\n \"voice_settings\": {\n \"speed\": 123,\n \"style\": 123,\n \"stability\": 123,\n \"similarity_boost\": 123,\n \"use_speaker_boost\": true\n },\n \"apply_text_normalization\": \"<string>\",\n \"apply_language_text_normalization\": true,\n \"pronunciation_dictionary_locators\": [\n {\n \"version_id\": \"<string>\",\n \"pronunciation_dictionary_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/elevenlabs-tts-v3")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"seed\": 123,\n \"text\": \"<string>\",\n \"stream\": true,\n \"voice_id\": \"<string>\",\n \"language_code\": \"<string>\",\n \"output_format\": \"<string>\",\n \"use_pvc_as_ivc\": true,\n \"voice_settings\": {\n \"speed\": 123,\n \"style\": 123,\n \"stability\": 123,\n \"similarity_boost\": 123,\n \"use_speaker_boost\": true\n },\n \"apply_text_normalization\": \"<string>\",\n \"apply_language_text_normalization\": true,\n \"pronunciation_dictionary_locators\": [\n {\n \"version_id\": \"<string>\",\n \"pronunciation_dictionary_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body選択した音声でテキストを音声に変換し、音声データを返します。
リクエストヘッダー
string
必須
列挙値:
application/jsonstring
必須
Bearer 認証形式: Bearer {{API Key}}。
リクエストボディ
integer
指定した場合、システムは可能な限り決定論的にサンプリングします。同じseedおよびパラメータでリクエストを繰り返すと同じ結果が返るはずですが、完全な決定性は保証されません。値の範囲:[0, 4294967295]
string
必須
音声に変換するテキスト。
boolean
Stream モードを有効にするかどうか
string
必須
使用する音声ID。
string
モデルおよびテキスト正規化に使用する言語コード(ISO 639-1)。モデルがこの言語コードをサポートしていない場合、エラーが返されます。
string
デフォルト:"mp3_44100_128"
生成される音声の出力形式。形式は codec_sample_rate_bitrate です。MP3の192kbpsビットレートにはCreator以上のアカウントが必要で、PCMの44.1kHzサンプリングレートにはPro以上のアカウントが必要です。使用可能な値:
mp3_22050_32, mp3_24000_48, mp3_44100_32, mp3_44100_64, mp3_44100_96, mp3_44100_128, mp3_44100_192, pcm_8000, pcm_16000, pcm_22050, pcm_24000, pcm_32000, pcm_44100, pcm_48000, ulaw_8000, alaw_8000, opus_48000_32, opus_48000_64, opus_48000_96, opus_48000_128, opus_48000_192boolean
デフォルト:false
true の場合、PVCバージョンではなくIVCバージョンの音声を使用します。これはPVCバージョンの高いレイテンシに対する一時的な対策です。
object
非表示 properties
非表示 properties
number
デフォルト:1
音声の速度を調整します。1.0がデフォルト速度で、1.0未満では話速が遅くなり、1.0を超えると話速が速くなります。
number
デフォルト:0
音声スタイルの誇張の度合いを決定します。元の話者のスタイルを強調しようとします。0以外に設定すると、より多くの計算リソースを消費し、レイテンシが増加する可能性があります。
number
音声生成の安定性と、各生成間のランダム性を決定します。低い値ではより広い感情表現が得られ、高い値では音声が単調になる可能性があります。
number
AI が元の音声を再現しようとする際の一致度を決定します。
boolean
デフォルト:true
元の話者との類似度を強化します。やや高い計算負荷が必要で、レイテンシが増加します。
string
デフォルト:"auto"
テキスト正規化を制御します。‘auto’ はシステムが判断し、‘on’ は常に正規化し、‘off’ はスキップします。使用可能な値:
auto, on, offboolean
デフォルト:false
一部の対応言語に対して、より自然な発音を実現するための言語テキスト正規化を制御します。警告:レイテンシが大幅に増加する可能性があります。現在は日本語のみ対応しています。
object[]
レスポンス情報
生成された音声ファイル 形式:binary⌘I