@timesinternet/times-text-to-speech

1.0.0 • Public • Published

swiper

A React component to convert text to audio

Installation

Browser

npm install --save times-text-to-speech

Browser

import Swipe from 'times-swiper';
import from './node_modules/text-to-speech/text-to-speech.js';
import TTS from 'text-to-speech';



export class MyComponent extends Component {
  play(){
    TTS.play("Hello world text","english");
  }

  stop(){
    TTS.stop();
  }
  render(){
    return(
      <div>
        <button onClick={this.play.bind(this)}>Play</button>
        <button onClick={this.stop.bind(this)}>Stop</button>
      </div>   
    )
  }
}

export default MyComponent;

Available functions

  • play: play text in hindi or english (language options are 'hindi','english')
  • stop: stop audio

Who's using text-to-speech?

License

This project is licensed under the terms of the

Package Sidebar

Install

npm i @timesinternet/times-text-to-speech

Weekly Downloads

2

Version

1.0.0

License

ISC

Unpacked Size

54.9 kB

Total Files

4

Last publish

Collaborators

  • mohit.rathi
  • sandeep.panwar
  • til