Fish Audio S2 Pro テキスト読み上げ
curl --request POST \
--url https://api.highwayapi.ai/v3/fish-audio-s2-pro-text-to-speech \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"text": "<string>",
"top_p": 123,
"format": "<string>",
"latency": "<string>",
"prosody": {
"speed": 123,
"volume": 123,
"normalize_loudness": true
},
"normalize": true,
"references": [
{
"text": "<string>",
"audio": "<string>"
}
],
"mp3_bitrate": 123,
"sample_rate": 123,
"temperature": 123,
"chunk_length": 123,
"opus_bitrate": 123,
"reference_id": "<string>",
"max_new_tokens": 123,
"min_chunk_length": 123,
"repetition_penalty": 123,
"early_stop_threshold": 123,
"condition_on_previous_chunks": true
}
'import requests
url = "https://api.highwayapi.ai/v3/fish-audio-s2-pro-text-to-speech"
payload = {
"text": "<string>",
"top_p": 123,
"format": "<string>",
"latency": "<string>",
"prosody": {
"speed": 123,
"volume": 123,
"normalize_loudness": True
},
"normalize": True,
"references": [
{
"text": "<string>",
"audio": "<string>"
}
],
"mp3_bitrate": 123,
"sample_rate": 123,
"temperature": 123,
"chunk_length": 123,
"opus_bitrate": 123,
"reference_id": "<string>",
"max_new_tokens": 123,
"min_chunk_length": 123,
"repetition_penalty": 123,
"early_stop_threshold": 123,
"condition_on_previous_chunks": True
}
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({
text: '<string>',
top_p: 123,
format: '<string>',
latency: '<string>',
prosody: {speed: 123, volume: 123, normalize_loudness: true},
normalize: true,
references: [{text: '<string>', audio: '<string>'}],
mp3_bitrate: 123,
sample_rate: 123,
temperature: 123,
chunk_length: 123,
opus_bitrate: 123,
reference_id: '<string>',
max_new_tokens: 123,
min_chunk_length: 123,
repetition_penalty: 123,
early_stop_threshold: 123,
condition_on_previous_chunks: true
})
};
fetch('https://api.highwayapi.ai/v3/fish-audio-s2-pro-text-to-speech', 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/fish-audio-s2-pro-text-to-speech",
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([
'text' => '<string>',
'top_p' => 123,
'format' => '<string>',
'latency' => '<string>',
'prosody' => [
'speed' => 123,
'volume' => 123,
'normalize_loudness' => true
],
'normalize' => true,
'references' => [
[
'text' => '<string>',
'audio' => '<string>'
]
],
'mp3_bitrate' => 123,
'sample_rate' => 123,
'temperature' => 123,
'chunk_length' => 123,
'opus_bitrate' => 123,
'reference_id' => '<string>',
'max_new_tokens' => 123,
'min_chunk_length' => 123,
'repetition_penalty' => 123,
'early_stop_threshold' => 123,
'condition_on_previous_chunks' => true
]),
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/fish-audio-s2-pro-text-to-speech"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"top_p\": 123,\n \"format\": \"<string>\",\n \"latency\": \"<string>\",\n \"prosody\": {\n \"speed\": 123,\n \"volume\": 123,\n \"normalize_loudness\": true\n },\n \"normalize\": true,\n \"references\": [\n {\n \"text\": \"<string>\",\n \"audio\": \"<string>\"\n }\n ],\n \"mp3_bitrate\": 123,\n \"sample_rate\": 123,\n \"temperature\": 123,\n \"chunk_length\": 123,\n \"opus_bitrate\": 123,\n \"reference_id\": \"<string>\",\n \"max_new_tokens\": 123,\n \"min_chunk_length\": 123,\n \"repetition_penalty\": 123,\n \"early_stop_threshold\": 123,\n \"condition_on_previous_chunks\": true\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/fish-audio-s2-pro-text-to-speech")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"text\": \"<string>\",\n \"top_p\": 123,\n \"format\": \"<string>\",\n \"latency\": \"<string>\",\n \"prosody\": {\n \"speed\": 123,\n \"volume\": 123,\n \"normalize_loudness\": true\n },\n \"normalize\": true,\n \"references\": [\n {\n \"text\": \"<string>\",\n \"audio\": \"<string>\"\n }\n ],\n \"mp3_bitrate\": 123,\n \"sample_rate\": 123,\n \"temperature\": 123,\n \"chunk_length\": 123,\n \"opus_bitrate\": 123,\n \"reference_id\": \"<string>\",\n \"max_new_tokens\": 123,\n \"min_chunk_length\": 123,\n \"repetition_penalty\": 123,\n \"early_stop_threshold\": 123,\n \"condition_on_previous_chunks\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/fish-audio-s2-pro-text-to-speech")
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 \"text\": \"<string>\",\n \"top_p\": 123,\n \"format\": \"<string>\",\n \"latency\": \"<string>\",\n \"prosody\": {\n \"speed\": 123,\n \"volume\": 123,\n \"normalize_loudness\": true\n },\n \"normalize\": true,\n \"references\": [\n {\n \"text\": \"<string>\",\n \"audio\": \"<string>\"\n }\n ],\n \"mp3_bitrate\": 123,\n \"sample_rate\": 123,\n \"temperature\": 123,\n \"chunk_length\": 123,\n \"opus_bitrate\": 123,\n \"reference_id\": \"<string>\",\n \"max_new_tokens\": 123,\n \"min_chunk_length\": 123,\n \"repetition_penalty\": 123,\n \"early_stop_threshold\": 123,\n \"condition_on_previous_chunks\": true\n}"
response = http.request(request)
puts response.read_body音声
Fish Audio S2 Pro テキスト読み上げ
POST
/
v3
/
fish-audio-s2-pro-text-to-speech
Fish Audio S2 Pro テキスト読み上げ
curl --request POST \
--url https://api.highwayapi.ai/v3/fish-audio-s2-pro-text-to-speech \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"text": "<string>",
"top_p": 123,
"format": "<string>",
"latency": "<string>",
"prosody": {
"speed": 123,
"volume": 123,
"normalize_loudness": true
},
"normalize": true,
"references": [
{
"text": "<string>",
"audio": "<string>"
}
],
"mp3_bitrate": 123,
"sample_rate": 123,
"temperature": 123,
"chunk_length": 123,
"opus_bitrate": 123,
"reference_id": "<string>",
"max_new_tokens": 123,
"min_chunk_length": 123,
"repetition_penalty": 123,
"early_stop_threshold": 123,
"condition_on_previous_chunks": true
}
'import requests
url = "https://api.highwayapi.ai/v3/fish-audio-s2-pro-text-to-speech"
payload = {
"text": "<string>",
"top_p": 123,
"format": "<string>",
"latency": "<string>",
"prosody": {
"speed": 123,
"volume": 123,
"normalize_loudness": True
},
"normalize": True,
"references": [
{
"text": "<string>",
"audio": "<string>"
}
],
"mp3_bitrate": 123,
"sample_rate": 123,
"temperature": 123,
"chunk_length": 123,
"opus_bitrate": 123,
"reference_id": "<string>",
"max_new_tokens": 123,
"min_chunk_length": 123,
"repetition_penalty": 123,
"early_stop_threshold": 123,
"condition_on_previous_chunks": True
}
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({
text: '<string>',
top_p: 123,
format: '<string>',
latency: '<string>',
prosody: {speed: 123, volume: 123, normalize_loudness: true},
normalize: true,
references: [{text: '<string>', audio: '<string>'}],
mp3_bitrate: 123,
sample_rate: 123,
temperature: 123,
chunk_length: 123,
opus_bitrate: 123,
reference_id: '<string>',
max_new_tokens: 123,
min_chunk_length: 123,
repetition_penalty: 123,
early_stop_threshold: 123,
condition_on_previous_chunks: true
})
};
fetch('https://api.highwayapi.ai/v3/fish-audio-s2-pro-text-to-speech', 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/fish-audio-s2-pro-text-to-speech",
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([
'text' => '<string>',
'top_p' => 123,
'format' => '<string>',
'latency' => '<string>',
'prosody' => [
'speed' => 123,
'volume' => 123,
'normalize_loudness' => true
],
'normalize' => true,
'references' => [
[
'text' => '<string>',
'audio' => '<string>'
]
],
'mp3_bitrate' => 123,
'sample_rate' => 123,
'temperature' => 123,
'chunk_length' => 123,
'opus_bitrate' => 123,
'reference_id' => '<string>',
'max_new_tokens' => 123,
'min_chunk_length' => 123,
'repetition_penalty' => 123,
'early_stop_threshold' => 123,
'condition_on_previous_chunks' => true
]),
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/fish-audio-s2-pro-text-to-speech"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"top_p\": 123,\n \"format\": \"<string>\",\n \"latency\": \"<string>\",\n \"prosody\": {\n \"speed\": 123,\n \"volume\": 123,\n \"normalize_loudness\": true\n },\n \"normalize\": true,\n \"references\": [\n {\n \"text\": \"<string>\",\n \"audio\": \"<string>\"\n }\n ],\n \"mp3_bitrate\": 123,\n \"sample_rate\": 123,\n \"temperature\": 123,\n \"chunk_length\": 123,\n \"opus_bitrate\": 123,\n \"reference_id\": \"<string>\",\n \"max_new_tokens\": 123,\n \"min_chunk_length\": 123,\n \"repetition_penalty\": 123,\n \"early_stop_threshold\": 123,\n \"condition_on_previous_chunks\": true\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/fish-audio-s2-pro-text-to-speech")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"text\": \"<string>\",\n \"top_p\": 123,\n \"format\": \"<string>\",\n \"latency\": \"<string>\",\n \"prosody\": {\n \"speed\": 123,\n \"volume\": 123,\n \"normalize_loudness\": true\n },\n \"normalize\": true,\n \"references\": [\n {\n \"text\": \"<string>\",\n \"audio\": \"<string>\"\n }\n ],\n \"mp3_bitrate\": 123,\n \"sample_rate\": 123,\n \"temperature\": 123,\n \"chunk_length\": 123,\n \"opus_bitrate\": 123,\n \"reference_id\": \"<string>\",\n \"max_new_tokens\": 123,\n \"min_chunk_length\": 123,\n \"repetition_penalty\": 123,\n \"early_stop_threshold\": 123,\n \"condition_on_previous_chunks\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/fish-audio-s2-pro-text-to-speech")
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 \"text\": \"<string>\",\n \"top_p\": 123,\n \"format\": \"<string>\",\n \"latency\": \"<string>\",\n \"prosody\": {\n \"speed\": 123,\n \"volume\": 123,\n \"normalize_loudness\": true\n },\n \"normalize\": true,\n \"references\": [\n {\n \"text\": \"<string>\",\n \"audio\": \"<string>\"\n }\n ],\n \"mp3_bitrate\": 123,\n \"sample_rate\": 123,\n \"temperature\": 123,\n \"chunk_length\": 123,\n \"opus_bitrate\": 123,\n \"reference_id\": \"<string>\",\n \"max_new_tokens\": 123,\n \"min_chunk_length\": 123,\n \"repetition_penalty\": 123,\n \"early_stop_threshold\": 123,\n \"condition_on_previous_chunks\": true\n}"
response = http.request(request)
puts response.read_bodyFish Audio S2 Pro テキスト読み上げモデルは、テキストを自然な音声に変換し、参照音色、サンプリング制御、分割、音声形式、韻律制御をサポートします。
リクエストヘッダー
string
必須
列挙値:
application/jsonstring
必須
Bearer 認証形式: Bearer {{API Key}}。
リクエスト本文
string
必須
音声に変換するテキスト。S2-Pro のマルチスピーカーテキストでは、<|speaker:0|>你好<|speaker:1|>你好呀 タグを使用できます。
number
nucleus sampling の多様性制御。値の範囲:[0, 1]
string
デフォルト:"mp3"
出力音声形式。指定可能な値:
wav, pcm, mp3, opusstring
デフォルト:"normal"
レイテンシーの段階。指定可能な値:
low, normal, balancedboolean
デフォルト:true
中国語・英語テキストを正規化します。
object[]
integer
デフォルト:128
MP3 ビットレート。単位は kbps。指定可能な値:
64, 128, 192integer
出力サンプリングレート Hz。空の場合は形式のデフォルト値を使用します。opus は 48000 Hz、それ以外は通常 44100 Hz です。
number
表現力の制御。値の範囲:[0, 1]
integer
デフォルト:300
テキスト分割サイズ。値の範囲:[100, 300]
integer
Opus ビットレート。単位は bps。-1000 は自動を表します。指定可能な値:
-1000, 24000, 32000, 48000, 64000string
音色モデル ID。マルチスピーカーのシーンでは、speaker インデックスに対応する配列を渡すことができます。
integer
デフォルト:1024
各分割の最大音声 token 数。
integer
デフォルト:50
分割前の最小文字数。値の範囲:[0, 100]
number
音声パターンの繰り返しを低減するペナルティ係数。
number
デフォルト:1
早期停止しきい値。値の範囲:[0, 1]
boolean
デフォルト:true
前の音声分割をコンテキストとして使用します。
レスポンス情報
生成された音声。 形式:binary⌘I