JSON
JSON (JavaScript Object Notation) is a language independent, lightweight data-interchange format. It is self-describing and easy to understand.Hence its is an easy-to-use alternative to XML. The JSON format is syntactically identical to the code for creating JavaScript objects.
var employees = [ {"firstName":"Albert", "lastName":"Einstein"}, {"firstName":"Steve", "lastName":"Jobs"}, {"firstName":"Bill","lastName": "Gates"} ]; // The JavaScript function JSON.parse(text) can be used to // convert a JSON text into a JavaScript object: // returns Albert Einstein employees[0].firstName + " " + employees[0].lastName; // alternate way employees[0]["firstName"] + " " + employees[0]["lastName"]; // To extract key names var keys = []; for ( var k in employees[0] ) { keys.push( k ); // the property name } // To extract key names in modern browser var keys = Object.keys( employees[0] ); // returns firstName keys[0]; // Based on the above extract name // returns Albert employees[0][keys[0]]; //
SSML
SSML (Speech Synthesis Markup Language) is a markup language that provides a standard way to mark up text for the generation of synthetic speech. The Alexa Skills Kit supports a subset of the tags defined in the SSML specification.
Provide the marked-up text in the outputSpeech property, but set the type to SSML instead of PlainText. Use the ssml property instead of text for the marked-up text:
"outputSpeech": { "type": "SSML", "ssml": "<speak>This output speech uses SSML.</speak>" }
The SSML must be wrapped within tags. For example:
<speak> Here is a number <w role="ivona:VBD">read</w> as a cardinal number: <say-as interpret-as="cardinal">12345</say-as>. Here is a word spelled out: <say-as interpret-as="spell-out">hello</say-as>. </speak>