Getting Started

JSonic consists of a server implementing a REST API for synthesizing speech utterances to web accessible files and client JavaScript that caches and plays speech and sound on demand. The current version implements the server using Tornado and the client using Dojo.

Requirements

The following lists show all of the minimum requirements for both the server and client. You do not have to download all of these up-front; the remaining sections walk you through how to .

The server Python code has been tested with these minimum versions:

  1. Python 2.6
  2. Tornado 0.2
  3. iterpipes 0.3
  4. espeak 1.36.02
  5. lame 3.98.2
  6. oggenc 1.2.0
  7. daemon 1.0 (optional)

The client JS code requires:

  1. Dojo 1.4.2 (from a CDN is fine)
  2. A browser supporting the HTML5 <audio> node
  3. A browser supporting HTML5 localStorage (optional)

Obtaining the JSonic source code

To get the latest stable release of JSonic:

  1. Visit http://github.com/uncopenweb/jsonic/downloads.
  2. Download the latest version.

To get the latest development code:

  1. Install git.

  2. Clone the JSonic git repository:

    git clone git://github.com/uncopenweb/jsonic.git
    

Running the Tornado server

  1. Install the prerequisites listed on the Tornado website.

  2. Install the Tornado web server.

  3. Install the iterpipes module.

  4. Install the espeak text-to-speech engine.

  5. Install LAME for MP3 encoding support.

  6. Install the oggenc utility from Vorbis tools for OGG encoding support.

  7. Start the JSonic server on port 8888 with 4 worker processes using the following command.

    cd jsonic/server
    python jsonic.py
    

To get a list of command line options, run the following command.

python jsonic.py --help

Loading the JSonic Dojo module

  1. Place the JSonic.js file in a web accessible location.
  2. Include Dojo in your web application.
  3. Inform Dojo of the location of the uow.audio namespace on disk.
  4. Use dojo.require to load the JSonic module.

See the HTML files in the examples/ folder for complete applications satisfying these requirements. You can run the examples by visiting the http://yourdomain:8888/static/examples/ URL of the JSonic server if you start the server with the –static parameter.

Speaking “Hello world!”

  1. Create a configuration object for JSonic.

    var args = {jsonicURI : '/jsonic', defaultCaching : true};
    
  2. Create an instance of the JSonic class

    var js = new uow.audio.JSonic(args);
    
  3. Invoke the JSonic.say method.

    js.say({text : 'Hello world!'})