add:CustomTTS提供一个示例

This commit is contained in:
hrz
2025-05-22 11:22:16 +08:00
parent 46a15082d6
commit 1ad8aeeaa7
+16 -9
View File
@@ -675,17 +675,24 @@ TTS:
speed: 1
output_dir: tmp/
CustomTTS:
# 自定义的TTS接口服务,请求参数可自定义
# 要求接口使用GET方式请求,并返回音频文件
# 自定义的TTS接口服务,请求参数可自定义,可接入众多TTS服务
# 以本地部署的KokoroTTS为例
# 如果只有cpu运行:docker run -p 8880:8880 ghcr.io/remsky/kokoro-fastapi-cpu:latest
# 如果只有gpu运行:docker run --gpus all -p 8880:8880 ghcr.io/remsky/kokoro-fastapi-gpu:latest
# 要求接口使用POST方式请求,并返回音频文件
type: custom
url: "http://127.0.0.1:9880/tts"
method: POST
url: "http://127.0.0.1:8880/v1/audio/speech"
params: # 自定义请求参数
# text: "{prompt_text}" # {prompt_text}会被替换为实际的提示词内容
# speaker: jok老师
# speed: 1
# foo: bar
# testabc: 123456
input: "{prompt_text}"
response_format: "mp3"
download_format: "mp3"
voice: "zf_xiaoxiao"
lang_code: "z"
return_download_link: true
speed: 1
stream: false
headers: # 自定义请求头
# Authorization: Bearer xxxx
format: wav # 接口返回的音频格式
format: mp3 # 接口返回的音频格式
output_dir: tmp/