Fish Audio S2 Pro Text to Speech
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_bodyAudio
Fish Audio S2 Pro Text to Speech
POST
/
v3
/
fish-audio-s2-pro-text-to-speech
Fish Audio S2 Pro Text to Speech
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_bodyDas Fish Audio S2 Pro Text-to-Speech-Modell wandelt Text in natürliche Sprache um und unterstützt Referenzstimmen, Sampling-Steuerung, Segmentierung, Audioformate und Prosodie-Steuerung.
Anfrage-Header
string
erforderlich
Enum-Wert:
application/jsonstring
erforderlich
Bearer-Authentifizierungsformat: Bearer {{API-Schlüssel}}.
Anfragebody
string
erforderlich
Der Text, der in Sprache umgewandelt werden soll. Für S2-Pro-Mehrsprecher-Text können die Tags <|speaker:0|>Hallo<|speaker:1|>Hallo zusammen verwendet werden.
number
Steuerung der Diversität beim Nucleus Sampling.Wertebereich: [0, 1]
string
Standard:"mp3"
Ausgabe-Audioformat.Optionale Werte:
wav, pcm, mp3, opusstring
Standard:"normal"
Latenzstufe.Optionale Werte:
low, normal, balancedobject
boolean
Standard:true
Normalisiert chinesischen und englischen Text.
object[]
integer
Standard:128
MP3-Bitrate in kbps.Optionale Werte:
64, 128, 192integer
Ausgabe-Samplerate in Hz. Wenn leer, wird der Standardwert des Formats verwendet; opus ist 48000 Hz, andere üblicherweise 44100 Hz.
number
Steuerung der Ausdrucksstärke.Wertebereich: [0, 1]
integer
Standard:300
Textsegmentgröße.Wertebereich: [100, 300]
integer
Opus-Bitrate in bps; -1000 bedeutet automatisch.Optionale Werte:
-1000, 24000, 32000, 48000, 64000string
Stimmenmodell-ID; in Mehrsprecher-Szenarien kann ein Array übergeben werden, das den speaker-Indizes entspricht.
integer
Standard:1024
Maximale Anzahl an Audio-Token pro Segment.
integer
Standard:50
Mindestanzahl an Zeichen vor der Segmentierung.Wertebereich: [0, 100]
number
Strafkoeffizient zur Reduzierung von Wiederholungen im Audiomuster.
number
Standard:1
Schwellenwert für vorzeitiges Stoppen.Wertebereich: [0, 1]
boolean
Standard:true
Verwendet vorherige Audiosegmente als Kontext.
Antwortinformationen
Generiertes Audio. Format:binary⌘I