Hagsten / Talkify

Javascript Text to speech library
216 stars 32 forks source link

Play simple text? #3

Closed glittle closed 7 years ago

glittle commented 7 years ago

The readme talks about Play simple text with talkify.playText('Hello world');.

However, there is no instruction on how to create talkify. Is it implicitly added to the window object?

Hagsten commented 7 years ago

Hi, I have updated that section of the readme now. You need to instantiate (or use an existing) a player and then invoke the playText method on the player specifying a string.

var player = new TtsPlayer(); //or new Html5Player() player.playText('Hello world');

Does that do the trick for you? :)