npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

chatluna-provider-fish-audio

v0.1.6

Published

Standalone Fish Audio TTS provider for ChatLuna v2

Readme

Fish Audio 语音合成插件 · ChatLuna v2

在 ChatLuna 中通过 说 命令调用 Fish Audio,将文字合成为语音。默认配置适合 QQ / OneBot 语音消息:插件请求 24 kHz PCM,在本地用 silk-wasm 编码为 SILK,这一步无需 FFmpeg。需要在浏览器中播放时,可以在供应商设置中选择 MP3。

安装并启用

准备 Node.js 24 或以上版本、Fish Audio API Key,以及已启用供应商管理和语音功能(如 @chatluna/chat-tts)的 ChatLuna 实例。插件适配 ChatLuna 2.0.0-alpha.0 和 Cordis 4.0.0-rc.12。

  1. 将 chatluna-provider-fish-audio-0.1.6.tgz 放在 ChatLuna 项目根目录,在该目录运行以下命令,将插件登记为项目的直接依赖。

    yarn add "chatluna-provider-fish-audio@file:./chatluna-provider-fish-audio-0.1.6.tgz"
  2. 在现有 chatluna.yml 的 models 分组中,将以下条目追加到 config 数组,保留原有条目。完整缩进见 YAML 示例。

    - id: fish-audio-catalog
      name: chatluna-provider-fish-audio/catalog
  3. 重启 ChatLuna 或重载配置,刷新 WebUI,在「提供商 → 添加提供商」中选择 Fish Audio。填写 API Key 和模型后保存。密钥由宿主的凭据管理功能处理。

  4. 将语音角色 @speak 指向 fish-audio:s2.1-pro-free。如果自定义了登记名或模型 ID,使用对应的 登记名:模型ID。

供应商配置

| 界面字段 | 默认值 | 用法 | | --- | --- | --- | | 提供商登记名 | fish-audio | 配置多个实例时,为每个实例使用独立的登记名。 | | Fish Audio API Key | 必填 | 填写 Fish Audio 账户的密钥。 | | API Base URL | https://api.fish.audio/v1 | 地址保留 /v1,插件会自动追加 /tts。 | | 默认声音 ID | 留空 | 填写 Fish 声音的 reference_id,也可在单次命令中用 -v 指定。 | | 语音模型 | s2.1-pro-free | 至少配置一个账户可用的模型。列表为空时点击「添加」。 | | 生成音频格式 | pcm | 可选 pcm、mp3、wav、opus。 | | PCM 采样率(Hz) | 24000 | 可选 8000、16000、24000、32000、44100。仅对 PCM 生效。 | | 合成超时时间(秒) | 20 | 最小值为 1。较长文本经常超时时可以调高。 |

发送语音

在机器人聊天中发送以下命令即可验证真实合成。这会使用已配置的 Fish Audio 账户发起请求。

说 你好,这是我的第一条语音。

使用 -v 可以临时覆盖默认声音。把示例中的 ID 换成你要使用的声音 ID。

说 -v 933563129e564b19a115bedd57b7406a [whispering] 这是一个小秘密。

[whispering]、[excited] 等情绪标签随正文原样发送,效果取决于所选模型。-s 或 <voice style="…"> 指定的语气会加在正文前面。例如,<voice style="生气">晚上好</voice> 会发送 [生气] 晚上好。语气描述保留原文,例如 warm and happy 会变成 [warm and happy]。

音频格式与 FFmpeg

「生成音频格式」决定插件向 Fish Audio 请求的格式。选择 PCM 时,请求和 SILK 编码使用同一采样率。

| 选择 | 交给 ChatLuna 的音频 | 适用场景 | | --- | --- | --- | | PCM | SILK(audio/silk) | QQ / OneBot 语音。插件直接将 PCM 编码为 SILK,无需 FFmpeg。 | | MP3 | MP3(audio/mpeg) | 浏览器可直接播放。发送 QQ / OneBot 语音时,宿主需要 FFmpeg 将 MP3 解码为 PCM,再编码为 SILK。 | | WAV | WAV(audio/wav) | 需要 WAV 文件或由下游处理音频时使用。 | | Opus | Ogg 封装的 Opus | 适合接收 Ogg/Opus 的下游,如 Telegram 语音。 |

Fish Audio 合成本身无需 FFmpeg。若目标平台的宿主适配器需要转码,请在运行 ChatLuna 的环境中安装 FFmpeg,加入 PATH,执行 ffmpeg -version 确认可用后重启宿主。容器部署时,在容器内执行检查。

常见问题

| 现象 | 检查方法 | | --- | --- | | 添加提供商时找不到 Fish Audio | 确认插件已登记为 ChatLuna 项目的直接依赖,/catalog 条目已加载,然后刷新供应商页面。 | | 点击供应商页面的「测试」后没有声音 | 该按钮用于绑定模型。请在聊天中发送 说 你好 验证合成与发送。 | | 鉴权失败或提示额度不足 | 检查供应商保存的 Fish Audio Key、账户余额和模型权限。 | | 接口返回路径或参数错误 | 核对 Base URL、模型 ID 和声音 ID。使用默认服务时,请求地址应为 https://api.fish.audio/v1/tts。 | | 已生成音频,但平台没有发送语音 | 检查 @speak 的绑定、宿主语音功能及平台适配器支持的音频格式。QQ / OneBot 可先用默认 PCM 测试。 |

开发与打包

在插件源码目录使用 Yarn 4 安装依赖、生成 WebUI 表单、运行检查并打包。

yarn install
yarn build
yarn check
yarn pack --out chatluna-provider-fish-audio-0.1.6.tgz

安装包包含生成好的 WebUI 表单,使用者可直接安装。许可证为 MIT。