Automatic Javascript API

The Automatic Javascript API helps you build speech mashups with a few lines of code. if you want to speech enable links or forms -- or add text to speech -- this API is a good choice. For more complex requirements check the advanced API.

Just include the following code in the header of you web page to provide users with a multi-modal UI.


Dependencies

There are three javascrpt dependecies: the base speechapi.js, swfobject.js and jquery.

Setup function

SpeechAPI's automatic mashup mode is configured with the setupPage method. If you are already familiar with speechapi's base javasscript API, you will recognize most of these parameters.

Paremeters to speech mashup setup function

Field Name Description
User id UserId (or DeveloperId)
Password Developer Password(or secret key)
SWF Name The name of swf container. You can use this to control the placement of the flash widget.
Server URL The url of the speech server. In those example we are using speechapis server running in the cloud that does RTPMP streaming on port 1935.
Linkables This is a lits of html tags that are hyperlinks that you can speak. Typically you would just want to use the 'a' tag here. The mashup library will use the name attribute as the grammar for the link. You can use JSGF grammar segments. More about that later.
Speakables This is a list of html tags that can be processed by the mashups text to speech service. You can click on these elements or speak the name of the element as specified in the name parameter. Again the name can contain a JSGF grammar segment. You must have an id paramter for speakable tags.
Focusables This is a list of input types, that can gain focus by speaking the name. Again the name can be a JSGF grammar segment. Examples include text and textarea.
Browser Control flag if true the user can scroll and change browser size using speech.
FormsEnabled Flag If true, the user can fill forms using speech. Grammar for the text field is required in the gram attribute of the input fields.