handlebars-ssml
v0.0.1
Published
SSML helpers for Handlebars
Downloads
2
Readme
Handlebars SSML
A set of helpers for Handlebars to make writing SSML easier.
Installation
npm install --save handlebars-ssml
Use
Say you've written a pre-processor for your Alexa skill speech using Handlebars – you can integrate the helpers into your Hanlebars instance:
const Handlebars = require('handlebars');
require('handlebars-ssml')(Handlebars);
Allowing you to use helpers that construct SSML in a more expressive way:
{{#emphasis}}Hello{{/emphasis}} world.
The {{#interjection}}quick{{/interjection}} brown fox jumped over the {{#effect 'whispered'}}lazy dog{{/effect}}.
Which would output:
<emphasis level="medium">Hello</emphasis> world.
The <say-as interpret-as="interjection">quick</say-as> brown fox jumped over the <amazon:effect name="whispered">lazy dog</amazon:effect>.
Aliases
There are several aliases for different tags and properties.
For example, instead of this:
<prosody volume="medium">To be, or not to be?</prosody> <prosody pitch="low">That is the question.</prosody>
You could write:
{{#medium-volume}}To be, or not to be?{{/medium-volume}} {{#low-pitch}}That is the question.{{/low-pitch}}
NOTES
Currently geared towards Alexa use, though it will be expanded to be less Amazon-specific.