Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
docs
  • Loading branch information
kripken committed Jan 13, 2012
1 parent 8dd86c5 commit 912f427
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions README.markdown
Expand Up @@ -15,9 +15,10 @@ Very simple! Do this:

* Include the script in your html header,

`<script src="speak.js"></script>`
`<script src="speakClient.js"></script>`

(and make sure you have speak.js where it will be found)
(and make sure you have speakClient.js available, as well as
speakWorker.js and speakGenerator.js)

* Add a div with an audio element called 'audio' in your html body,

Expand Down Expand Up @@ -47,6 +48,7 @@ available options are:
build speak.js to include the proper data. See Language Support
below) (default: en/en-us)
* wordgap: Additional gap between words in 10 ms units (default: 0)
* noWorker: Do not use a web worker (see below in 'Architecture')

For example

Expand All @@ -55,13 +57,29 @@ For example
will talk in a very high-pitched voice.


Architecture
------------

speakClient.js is the file that you interact with. It defines speak(), and
will load speakWorker.js in a web worker. speakWorker wraps around
speakGenerator.js, which does the actual work of converting a string into
a WAV file. The WAV data is returned to speak(), which then plays it in
an HTML Audio element.

You can also use speak.js without a web worker. In that case, you don't
need speakWorker.js, but you do need to load speakGenerator.js along
with speakClient.js in your HTML page. speak(), if called with noWorker
set to true in the options object, will directly call the WAV generation
code in speakGenerator.js instead of forwarding the call to a worker
which would have done the same.


Building
--------

A prebuilt version is already included, in the file speak.js. But if you want
to tinker with the source code though, you might want to build it yourself.
To do so, run emscripten.sh inside src/. Note that you need to change the paths
there.
A prebuilt version is already included. But if you want to tinker with the
source code though, you might want to build it yourself. To do so, run
emscripten.sh inside src/. Note that you need to change the paths there.


Language Support
Expand Down

0 comments on commit 912f427

Please sign in to comment.