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

@spcookie/erii-plugin-tts-azure-foundry

v1.0.1

Published

Erii TTS Azure Foundry plugin

Downloads

139

Readme

tts-azure-foundry

基于 Azure AI Foundry Speech 和 Microsoft Speech SDK 的 Erii SSML 语音合成插件。插件接收 SSML 内容片段,并将合成的 48 kHz、192 kbps MP3 音频作为 OneBot 群语音发送,并提供 sendAzureSpeech LLM 工具。

SSML 输入

sendAzureSpeechssml 参数是放在 <voice> 内部的 SSML 内容片段。不要传入 <speak><voice>;插件会根据当前 bot 的 voices.<botKey> 配置生成这两个外层元素,从而确保音色由配置 固定。例如:

<mstts:express-as style="cheerful">
  <prosody rate="+10%" pitch="+5%" volume="+5%">
    你好,<break time="500ms"/>欢迎使用 Erii。
  </prosody>
</mstts:express-as>

工具说明会提示 LLM 根据表达需要使用 Azure Speech 支持的完整内容能力:

  • 使用 ps 定义段落和句子;
  • 使用 breakmstts:silence 控制中断、暂停及静音;
  • 使用 bookmarkmstts:viseme 添加书签和视素事件标记;
  • 使用 emphasis 调整重音;
  • 使用 mstts:express-as 调整风格、风格强度和角色;
  • 使用 prosody 调整音调、音调轮廓、音域、语速和音量;
  • 使用 phonemesay-assub 控制发音和朗读方式;
  • 使用 langlexicon 调整语言、口音和发音词典;
  • 使用 audio 插入预录音频、音效或音符,并提供失败时的回退内容。

为了避免合成结果像在朗读书面材料,工具说明还要求 LLM 先把回答改写成自然口语:使用简洁短句和 日常措辞,移除 Markdown、链接及元话语,按语境选择单一且适度的风格,并克制使用停顿和韵律调整。

插件只固定外层结构和音色,不限制上述 <voice> 内部能力。它会拒绝包含 <speak><voice> 的输入,防止 SSML 覆盖配置音色。

配置

插件默认直接读取以下环境变量:

export AZURE_SPEECH_ENDPOINT="https://your-resource.cognitiveservices.azure.com/"
export AZURE_SPEECH_KEY="your-api-key"

也可以在 Erii 的插件配置目录中创建或修改 tts-azure-foundry.json

{
  "subscription-key": "${AZURE_SPEECH_KEY}",
  "endpoint": "${AZURE_SPEECH_ENDPOINT}",
  "voices": {
    "default": "zh-CN-Xiaoxiao:DragonHDFlashLatestNeural",
    "erii": "zh-CN-Yunxi:DragonHDFlashLatestNeural"
  }
}
  • endpoint:Azure Speech 资源页面提供的 Endpoint,必须使用 HTTPS。
  • subscription-key:Azure Speech 资源密钥。
  • voices.default:没有对应 botKey 配置时使用的默认音色。
  • voices.<botKey>:指定 bot 使用的音色。botKey 是 onebot.bots 下的配置键,例如上例中的 erii

插件按照当前 botId 获取 botKey,优先使用 voices.<botKey>;对应配置不存在或为空时回退到 voices.default。如果默认项也缺失或为空,则使用内置音色 zh-CN-Xiaoxiao:DragonHDFlashLatestNeural

AZURE_RESOURCE_ID 不参与订阅密钥方式的语音合成,不需要提供给插件。

构建

erii-plugins 目录执行:

./gradlew :tts:tts-azure-foundry:pluginZip

产物位于 tts/tts-azure-foundry/build/distributions/