Text To Speech JS

A small JavaScript library that provides a text to speech conversion using tts-api.com service.

View project onGitHub

Text To Speech JS

A small JavaScript library that provides a text to speech conversion using tts-api.com service.

How to use

Import the library in your web page:

<script src="path/to/text-to-speech.js"></script>

This will create a TextToSpeech gloabal object. It contains a talk method that is called like below:

TextToSpeech.talk("Hello Beautiful World!");

If a second argument is not provided the speech will start immediately.

Demo

TextToSpeech.talk("Hello Beautiful World!");

Methods

Name Arguments Description Example
talk
  • text - a string representing the text that must be converted in speech
  • notNow - a boolean value. If it's true, the speech will not start when the talk method is called.
The method that converts the text to speech. TextToSpeech.talk("Hello Beautiful World!");

</table.

License

The MIT License (MIT)

Copyright (c) 2014 Ionică Bizău

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.