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

dueros-ssml

v1.0.2

Published

dueros ssml

Downloads

17

Readme

dueros-ssml

dueros ssml

百度的 dueros 平台的 ssml 生成模块,详细见:https://dueros.baidu.com/didp/doc/dueros-bot-platform/dbp-custom/ssml_markdown

安装

npm install dueros-ssml --save

使用说明

  • 引入: const SsmlEntity = require('dueros-ssml')
  • 创建 SsmlEntity 对象: new SsmlEntity() or SsmlEntity.create()
  • text 方法会在当前节点层次插入文本,不会改变节点层次
  • 除了 text 方法,其他方法会进入创建的节点层次,可以通过 up 方法重新回到创建节点的父节点上
  • 当现有方法中没有要使用的节点方法可以通过 element(name, attrsObj = {}, text = '') 方法直接操作,可参考其他方法的实现
  • getStr 方法获取 ssml 字符串



示例

const SsmlEntity = require('dueros-ssml');

let str = SsmlEntity.create()
    .text('先放段音频:')
    .audio('百度云BOS的音频地址-wav格式').up()
    .text('播放完音频了')
    .text('开始播放背景音:')
    .background('百度云BOS的音频地址-wav格式').text('此时有背景音乐').sub('w3c', '万维网联盟').up().text('还在背景音乐的节点中').up()
    .text('这时候没有背景音乐,因为用up 方法跳出背景音乐节点了')
    .sayAs(SsmlEntity.SAY_AS_TYPE.NUMBER_DIGITS, '123123123').up()
    .sub('Gu', '胃溃疡').up()
    .silence(10).up()
    .msSilence(100).getStr();
console.log( `${str}` )

打印结果为:

<speak>先放段音频:<audio src="百度云BOS的音频地址-wav格式"/>播放完音频了开始播放背景音:<background src="百度云BOS的音频地址-wav格式" repeat="yes">此
时有背景音乐<sub alias="万维网联盟">w3c</sub>还在背景音乐的节点中</background>这时候没有背景音乐,因为用up 方法跳出背景音乐节点了<say-as type="number: digits">123123123</say-as><sub alias="胃溃疡">Gu</sub><silence time="10s"/><silence time="100ms"/></speak>