跳转到主要内容
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
}
'

Documentation Index

Fetch the complete documentation index at: https://docs.jiekou.ai/llms.txt

Use this file to discover all available pages before exploring further.

Fish Audio S2 Pro 文本转语音模型,将文本转换为自然语音,支持参考音色、采样控制、分段、音频格式和韵律控制。

请求头

Content-Type
string
必填
枚举值: application/json
Authorization
string
必填
Bearer 身份验证格式: Bearer {{API 密钥}}。

请求体

text
string
必填
需要转换为语音的文本。S2-Pro 多说话人文本可使用 <|speaker:0|>你好<|speaker:1|>你好呀 标签。
top_p
number
核采样多样性控制。取值范围:[0, 1]
format
string
默认值:"mp3"
输出音频格式。可选值:wav, pcm, mp3, opus
latency
string
默认值:"normal"
延迟档位。可选值:low, normal, balanced
prosody
object
韵律控制。
normalize
boolean
默认值:true
对中英文文本进行规范化。
references
array
用于零样本声音克隆的参考音频样本。
mp3_bitrate
integer
默认值:128
MP3 比特率,单位 kbps。可选值:64, 128, 192
sample_rate
integer
输出采样率 Hz。为空时使用格式默认值,opus 为 48000 Hz,其他通常为 44100 Hz。
temperature
number
表现力控制。取值范围:[0, 1]
chunk_length
integer
默认值:300
文本分段大小。取值范围:[100, 300]
opus_bitrate
integer
Opus 比特率,单位 bps,-1000 表示自动。可选值:-1000, 24000, 32000, 48000, 64000
reference_id
string
音色模型 ID;多说话人场景可传入与 speaker 索引匹配的数组。
max_new_tokens
integer
默认值:1024
每个分段的最大音频 token 数。
min_chunk_length
integer
默认值:50
分段前的最小字符数。取值范围:[0, 100]
repetition_penalty
number
降低音频模式重复的惩罚系数。
early_stop_threshold
number
默认值:1
提前停止阈值。取值范围:[0, 1]
condition_on_previous_chunks
boolean
默认值:true
使用前序音频分段作为上下文。

响应信息

生成的音频。 格式: binary