Coder Social home page Coder Social logo

opensea1993 / angular-tts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from duy-olli/angular-tts

0.0 1.0 0.0 448 KB

An AngularJS service to speak the text via the OpenFPT TTS (text-to-speech) API.

Home Page: http://ngtts.stis.vn/

License: MIT License

JavaScript 77.58% HTML 22.42%

angular-tts's Introduction

openfpt-ng-tts

An AngularJS service to speak the text via the OpenFPT TTS (text-to-speech) API.

Installation

Install through bower:

# from the terminal at the root of your project
bower install openfpt-ng-tts --save

Or you can install by this repo (not recommended)

# from the terminal at the root of your project
bower install fpt-corp/angular-tts --save

Add to your module deps

angular.module('xxx', ['fpt.angular-tts']);

Use

Get the API Key

Go to Open FPT API Developer Portal to get your API Key

Create a HTML Audio players on HTML file

    <audio id="openfpt-tts"> </audio>

Inject the service

Add openfptTts as injection to use in angular controller

angular.module('myApp').controller('HomeCtrl', ['$scope', 'openfptTts', function ($scope, openfptTts) {
    // Your code goes here   
}];

Global config

openfptTts.apiKey = 'YOUR_API_GOES_HERE';
openfptTts.elementId = 'openfpt-tts'; //default is 'openfpt-tts'
openfptTts.voice = 'both'; //default is 'both'
openfptTts.speed = 0; //default is 0
  • voice option can be male | female | both. When voice is set to both, the engine will speak with male voice and female voice sequentially.
  • speed option can be:
    • -3 : extreme slow
    • -2 : very slow
    • -1 : slow
    • 0 : normal (default)
    • 1 : fast
    • 2 : very fast
    • 3 : extreme fast

Method

openfptTts.speak(text, options, cb): Speak a singleline of text.

  • text string: Text you want to speak.
  • cb nodejs callback cb(err)

openfptTts.speakArray(textArray, options, cb): Speak sequentially.

  • textArray array[string]: Text you want to speak.
  • cb nodejs callback cb(err)

angular-tts's People

Contributors

ducminhquan avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.