ssmd

1.0.7 • Public • Published

SSMD

Build Status

Speech Synthesis Markdown (SSMD) is a lightweight alternative syntax for SSML. It's a node port of ruby ssmd

See specification of the language.

Requirements

Node 8 or later

Installation

npm install ssmd

Usage

const ssmd = require('ssmd');
 
const ssml = ssmd("hello *SSMD*!");
 
console.log(ssml);
 
<speak>
    hello <emphasis>SSMD</emphasis>!
</speak>

Options

const config = {
  outputSpeakTag: false, 
  prettyPrint: true,
  headingLevels: { 
    1: [{
        tag: "emphasis",
        value: 'strong'
      },
      {
        tag: "pause",
        value: '300ms'
      },
    ]
   }
};
 
ssmd(`
  # My first heading 1
  Hello world
  `,
  config
)
  <s>
     <emphasis level='strong'>
       My first heading 1
     </emphasis> 
     <break time=\'300ms\'/>
  </s>
  <s>
    Hello world
  </s>
  • outputSpeakTag (Boolean, default=true) Set it to false if you don't want to have tags included.
  • prettyPrint (String, default=true) Indent the resulting ssml.
  • headingLevels (Object) Customize the way heading tags will be transformed into SSML, default value is specified in specification.md

Note:

This version is still under development. See below which essential SSML constructs are implemented so far:

  • Text
  • Emphasis
  • Break
  • Language
  • Mark
  • Paragraph
  • Sentence
  • Phoneme
  • Prosody
  • Say-as
  • Substitution
  • Audio
  • Extensions

Tests

Run npm test to run the tests against a given executable.

This implementation and any other can be tested against the SSMD specification. Said specification is extracted from SPECIFICATION.md. It runs each SSMD snippet through the tested tool and compares it to the output of the following SSML snippet. If they match the test passes.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/fabien88/ssmd. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The module is available as open source under the terms of the MIT License.

Readme

Keywords

Package Sidebar

Install

npm i ssmd

Weekly Downloads

0

Version

1.0.7

License

MIT

Unpacked Size

21.6 kB

Total Files

8

Last publish

Collaborators

  • fabien88