-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
feature request: natively support Fish Audio TTS #1477
Description
Clear and concise description of the problem
摘要
希望能原生支持 Fish Audio 作为 TTS 提供商。他们生成的速度和质量都还不错,而且也已经有很多人生成过其他二次元角色语音,用起来会比较方便
Fish Audio API 文档:https://fish.audio/developers/
Suggested solution / Ideas
临时解决方案
在等待原生支持的同时,我让claude写了一个本地代理脚本,将 OpenAI 兼容格式的 TTS 请求转换为 Fish Audio 的 API 格式。
将软件的 Base URL 设置为 http://127.0.0.1:8880 即可直接使用。
配置步骤(新手友好)
步骤 1 和 2 只需要做一次。
之后每次使用,只需运行python fish_proxy.py启动服务即可。
步骤 1 — 一次性配置
1a. 保存并配置脚本
从此 Gist 下载 fish_proxy.py:https://gist.github.com/Find-A-Name-Is-Hard/c404da4580895d2f04f3bfb1e36c3fe4
保存到任意位置,例如 C:\fish_proxy\fish_proxy.py。
用记事本打开文件(右键 → 打开方式 → 记事本),找到顶部的配置区,大概长这样:
# Fish Audio API Key(留空则使用请求方透传的 Bearer Token)
# Leave empty to pass through the caller's Bearer Token
FISH_API_KEY = "your_fish_audio_api_key"
# Fish Audio 音色 ID(调用方传入任何 voice 名称都使用此 ID)
# Fish Audio voice ID — any voice name from the caller will be overridden by this
VOICE_ID = "your_voice_id"
# 语速,范围 0.5 ~ 2.0,1.0 为正常速度
# Speech speed, range 0.5 ~ 2.0, 1.0 is normal
SPEED = 1.0
...至少需要替换引号内的两个值:
FISH_API_KEY— 你的 Fish Audio API Key(在 Fish Audio 账户设置中获取)VOICE_ID— 你想使用的音色 ID(fish.audio 音色页面 URL 中的那串字符)
修改完成后保存文件(Ctrl + S)。
1b. 打开命令提示符
按 Win + R,输入 cmd,回车。
1c. 安装 Python
将以下命令粘贴到命令提示符中,回车执行,会自动下载并安装 Python:
winget install -e --id Python.Python.3
安装完成后,关闭并重新打开命令提示符窗口(下一步必须)。
1d. 安装依赖
粘贴以下命令并回车:
pip install fastapi uvicorn httpx ormsgpack pydantic
等待安装完成,最后看到 "Successfully installed ..." 即表示成功。
1e. 启动代理服务器
进入 fish_proxy.py 所在的文件夹并运行,例如:
cd C:\fish_proxy
python fish_proxy.py
看到 Uvicorn running on http://0.0.0.0:8880 即表示启动成功。使用软件期间请保持此窗口开着。
步骤 2 — 配置软件(一次性)
在软件中选择 OpenAI 兼容 API 作为 TTS 提供商,然后打开高级设置,填写:
- Base URL:
http://127.0.0.1:8880 - API Key:随便填(例如
sk-placeholder),此处填写的内容会被忽略,实际使用的是fish_proxy.py中配置的 Key - Model:
tts-1 - Voice:随便填,会被忽略 —— 实际使用的是
fish_proxy.py中配置的音色
之后每次使用,只需打开命令提示符运行:
python C:\fish_proxy\fish_proxy.py
然后正常启动软件即可。
希望对大家有帮助,也期待后续能有原生支持!
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.