Skip to content
/ ssmd Public
forked from fabien88/ssmd

Speech Synthesis Markdown (SSMD) alternative to SSML

Notifications You must be signed in to change notification settings

de-dan/ssmd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

import { ssmd } from '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.

About

Speech Synthesis Markdown (SSMD) alternative to SSML

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%