Socket
Socket
Sign inDemoInstall

wiki2ssml

Package Overview
Dependencies
1
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    wiki2ssml

Wiki2SSML provides the WikiVoice markup language used for fine-tuning synthesised voice.


Version published
Weekly downloads
34
increased by1033.33%
Maintainers
1
Install size
424 kB
Created
Weekly downloads
 

Readme

Source

Wiki2SSML

wiki2ssml can transform the WikiVoice markups into the W3C SSML widely supported by various text-to-speech services as an interchange format for synthesised voice tuning.

Introduction

wiki2ssml eases the burden of editors preparing scripts later used for speech synthesis. It is powered by WikiVoice which provides an unobtrusive solution of blending voice-tuning markups and free texts and a seamless experience of editing scripts and voices in one go.

Install

$ npm install wiki2ssml

or

$ yarn add wiki2ssml

WikiVoice Format

[[attribute:value(,attribute:value)*(|TEXT)*]]

Supported WikiVoice Markups

ExpressionsOperations
`[[volume:SCALETEXT]]`
`[[speed:SCALETEXT]]`
`[[pitch:SCALETEXT]]`
[[silence:TEXT]]Pause with duration
[[strength:TEXT]]Pause with strength
`[[emphasis:LEVELTEXT]]`
[[audio:AUDIO_URI]]Audio embedded into speech
`[[lang:LANGUAGETEXT]]`
`[[paragraphTEXT]]`
`[[sentenceTEXT]]`
`[[type:TYPETEXT]]`
`[[voice:NAMETEXT]]`
`[[pos:POSTEXT]]`
`[[substitute:TEXT1TEXT2]]`
`[[alphabet:ALP,pronunciation:PROTEXT]]`
`[[volume:SCALE,speed:SCALE,pitch:SCALETEXT]]`
`[[type:TYPE,format:FORMAT,detail:DETAILTEXT]]`

More details on canonical attribute values can be found at Speech Synthesis Markup Language (SSML).

Example

var parser = require("wiki2ssml");
try {
    var ssml = parser.parseToSsml("[[volume:+2dB,speed:50%|Speak this with the volume increased by 2dB at half the default speech rate.]]", "en-GB");
    console.log(ssml);
} catch (e) {
    if (e instanceof parser.SyntaxError) {
        // WikiVoice markups are invalid
    } else if (e instanceof parser.ArgumentError) {
        // The language code is missing
    } else {
        // Handle any unspecified exceptions
    }
}

will output:

<speak version="1.1" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd" xml:lang="en-GB">
    <prosody volume="+2dB" rate="50%">
    Speak this with the volume increased by 2dB at half the default speech rate.
    </prosody>
</speak>

Keywords

FAQs

Last updated on 02 Feb 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc