1.0.0 • Published 6 years ago

@timesinternet/times-text-to-speech v1.0.0

Weekly downloads
-
License
ISC
Repository
bitbucket
Last release
6 years ago

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

1.0.0

6 years ago