Fish Audio API
Generates speech audio from the provided text using Fish Audio Text-to-Speech service
Request Body
application/json
Optionaltext
Requiredstring1
Maximum length: 1024
chunk_length
integerChunk length to be used for the speech
200
Minimum: 100
Maximum: 300
format
stringOutput audio format
"opus"
Value in: "wav" | "pcm" | "mp3" | "opus"
mp3_bitrate
numberMP3 Bitrate to be used for the speech
128
opus_bitrate
numberOpus Bitrate to be used for the speech
64
references
array<object>References to be used for the speech, this requires MessagePack serialization, this will override reference_voices and reference_texts
voice
stringReference ID of the reference model o be used for the speech
normalize
booleanWhether to normalize the speech, this will reduce the latency but may reduce performance on numbers and dates
true
latency
stringLatency to be used for the speech, balanced will reduce the latency but may lead to performance degradation
"normal"
Value in: "normal" | "balanced"
token
RequiredstringFish Audio API key for authentication
1
Response Body
Audio file containing the generated speech
TypeScript Definitions
Use the response body type in TypeScript.
response
RequiredunknownBad request - validation error
TypeScript Definitions
Use the response body type in TypeScript.
success
Requiredbooleanfalse
message
Requiredstringcode
Requiredstringtype
RequiredstringServer error or Fish Audio API error
TypeScript Definitions
Use the response body type in TypeScript.
success
Requiredbooleanfalse
message
Requiredstringcode
Requiredstringtype
Requiredstringcurl -X POST "https://edge-workers.laplace.cn/laplace/tts-fishaudio" \
-H "Content-Type: application/json" \
-d '{
"text": "感谢ドラゴンラプラスWeChat的SC:一发sc没被念到我就冷汗直流心跳加速头皮发麻双手痉挛两腿打颤,还不好意思刷弹幕说你漏了,我好怕你看到了装作没看到。我的sc通常很短只有一小时,只有短短的3600秒,但它存在的时候,我会用心跳来为它倒数。私のBANを解除してください。もう二度とスパムしません😭",
"chunk_length": 200,
"format": "wav",
"mp3_bitrate": 128,
"opus_bitrate": 64,
"references": [
{
"audio": "string",
"text": "string"
}
],
"voice": "string",
"normalize": true,
"latency": "normal",
"token": "string"
}'
const body = JSON.stringify({
"text": "感谢ドラゴンラプラスWeChat的SC:一发sc没被念到我就冷汗直流心跳加速头皮发麻双手痉挛两腿打颤,还不好意思刷弹幕说你漏了,我好怕你看到了装作没看到。我的sc通常很短只有一小时,只有短短的3600秒,但它存在的时候,我会用心跳来为它倒数。私のBANを解除してください。もう二度とスパムしません😭",
"chunk_length": 200,
"format": "wav",
"mp3_bitrate": 128,
"opus_bitrate": 64,
"references": [
{
"audio": "string",
"text": "string"
}
],
"voice": "string",
"normalize": true,
"latency": "normal",
"token": "string"
})
fetch("https://edge-workers.laplace.cn/laplace/tts-fishaudio", {
body
})
package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://edge-workers.laplace.cn/laplace/tts-fishaudio"
body := strings.NewReader(`{
"text": "感谢ドラゴンラプラスWeChat的SC:一发sc没被念到我就冷汗直流心跳加速头皮发麻双手痉挛两腿打颤,还不好意思刷弹幕说你漏了,我好怕你看到了装作没看到。我的sc通常很短只有一小时,只有短短的3600秒,但它存在的时候,我会用心跳来为它倒数。私のBANを解除してください。もう二度とスパムしません😭",
"chunk_length": 200,
"format": "wav",
"mp3_bitrate": 128,
"opus_bitrate": 64,
"references": [
{
"audio": "string",
"text": "string"
}
],
"voice": "string",
"normalize": true,
"latency": "normal",
"token": "string"
}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
import requests
url = "https://edge-workers.laplace.cn/laplace/tts-fishaudio"
body = {
"text": "感谢ドラゴンラプラスWeChat的SC:一发sc没被念到我就冷汗直流心跳加速头皮发麻双手痉挛两腿打颤,还不好意思刷弹幕说你漏了,我好怕你看到了装作没看到。我的sc通常很短只有一小时,只有短短的3600秒,但它存在的时候,我会用心跳来为它倒数。私のBANを解除してください。もう二度とスパムしません😭",
"chunk_length": 200,
"format": "wav",
"mp3_bitrate": 128,
"opus_bitrate": 64,
"references": [
{
"audio": "string",
"text": "string"
}
],
"voice": "string",
"normalize": true,
"latency": "normal",
"token": "string"
}
response = requests.request("POST", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text)
null
{
"success": false,
"message": "string",
"code": "string",
"type": "string"
}
{
"success": false,
"message": "string",
"code": "string",
"type": "string"
}