Package Exports
- @timesinternet/times-text-to-speech
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@timesinternet/times-text-to-speech) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
swiper
A React component to convert text to audio
Installation
Browser
npm install --save times-text-to-speechBrowser
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