WebSpeech

简体中文版

(updated on May 3, 2013)

WebSpeech is a Javascript library for developers who want to write pages with voice. WebSpeech supports Android and iOS 4 or newer. It can be downloaded from http://sourceforge.net/projects/e-guidedog/files/WebSpeech/. And here is a WebSpeech module for Drupal 7

Here is a simple example:

<html>
  <head>
    <script type='text/javascript'
      src='/WebSpeech/WebSpeech.js'></script>
  </head>
  <body>
    Have you heard the voice?
    If not, please make sure Flash plug-in has been installed.
    And this example should be put on web server
    (not open it as a local file)!!
    <script type='text/javascript'>
      WebSpeech.ready(function() {
        WebSpeech.setVoice('en');
        WebSpeech.speak('hello world');
      }
    </script>
  </body>
</html>

Here is a more complicated example:


Language: Variant:
Speed Delta(-50..100): Pitch Delta(-100..100): Volume Delta(-100..100):

And here are some more examples written with WebSpeech:

Why can we make web page speakable with WebSpeech? That's because there is a Web TTS server behind it. The default Web TTS server is http://wa.eguidedog.net. This server provides free service for the public. You can also setup your own Web TTS server with instruction of How to setup eSpeak TTS server for WebSpeech. If you think this service is useful, I really appreciate your donation, which is significant to the persistence of WebSpeech and eGuideDog project.

We also provide TTS server setup and maintenance service. The fee is USD 200 or RMB 1000 for one server setup and one month maintenance. Please contact Cameron Wong (hgneng at gmail.com) for the service.

Here is the API of WebSpeech:

// default is 'http://wa.eguidedog.net'
WebSpeech.server = 'your new TTS server';

WebSpeech.speak('text to speak');
WebSpeech.pause();
WebSpeech.resume();
WebSpeech.stop();

// read current HTML page
WebSpeech.speakHtml();
WebSpeech.pauseHtml();
WebSpeech.stopHtml();

// execute function when Webspeech initialized
WebSpeech.ready(function () { ... });

// set callback function, which will be called when speeches finish
WebSpeech.onfinish = function () { ... };

// voiceName can be EkhoMandarin (default), EkhoCantonese
// or any voice name in eSpeak
WebSpeech.setVoice('voiceName');

WebSpeech.getSpeedDelta(); // return speed delta
WebSpeech.setSpeedDelta(value); // -50 <= value <= 100
WebSpeech.getPitchDelta();
WebSpeech.setPitchDelta(value); // -100 <= value <= 100
WebSpeech.getVolumeDelta();
WebSpeech.setVolumeDelta(value); // -100 <= value <= 100

// like SaveAs action in the browser
WebSpeech.saveMp3('text to save to MP3 format file');
WebSpeech.saveOgg('text to save to OGG format file');

// when data available, callback function will be called and
// the result will pass as the arguments.
WebSpeech.getPhonSymbols('text', function (success, symbols) { ... });

License: GPLv2+


Support This Project Get eGuideDog software for the blind at SourceForge.net. Fast, secure and Free Open Source software downloads