Give a voice to your website in a matter of minutes. Talkify library provides you with high quality text to speech (TTS) voices in many languages.
$ bower install talkify
$ npm install talkify-tts
var player = ;//<--Any element you'd like. Leave blank to let Talkify make a good guess//<-- Returns an instance.;
var player = ; //or new talkify.Html5Player()player;
talkifyconfig =host: '' //Host of streamed audio media.useRemoteServices: true //True to use Talkifys language engine and hosted voices. False only works for Html5Player.ui:audioControls: //If enabled, replaces the built in audio controls. Especially good for the Web Speech API bitsenabled: falsecontainer: documentbody
Talkify lives in its own namespace - talkify. Hence, everything below is scoped to that namespace (i.e. talkify.playlist, etc). ## Playlist fluent builder Playlist builder is Talkifys way to instantiate your playlist. It comes with a fluent API.
Entry point: talkify.playlist()
|begin||Entry point. Call this to start building your playlist||Yes|
|usingPlayer||TtsPlayer/Html5Player||Specify which player to be used.||Yes|
|withTextInteraction||Enables you to click on paragraphs (and other text) to play||No|
|withElements||DOM elements||Specifies with elements to play. If omitted, Talkify will crawl the page and select for you||No|
|withRootSelector||string||'body'||Sets the scope from where Talkify will start to crawl the page for text to play||No|
|subscribeTo||Json object||Event subscriptions||No|
|build||Finalizes and creates the playlist instance||Yes|
This is the instance built from the playliste above.
|getQueue||Returns the playlist queue|
|play||Begins playback of playlist|
|replayCurrent||Replays the current item in the playlist|
|insert||DOM element||Inserts new html elements to play. Useful for elements that Talkify were unable to locate. Elements will be inserted in correct order with respect to the page.|
|isPlaying||True if any item is currently in a playing state|
|setPlayer||TtsPlayer/Html5Player||Sets the player that the playlist is using|
|enableTextInteraction||Enables click to play on HTML elements|
|disableTextInteraction||Disables click to play on HTML elements|
|enableTextHighlighting||Tells the player to use text highlighting. For Html5Player this only works on localVoice.|
|disableTextHighlighting||Turns off text highlighting.|
|subscribeTo||Json object||Event listeners|
|playText||string||Plays a text|
|paused||True if paused|
|isPlaying||True if playing|
|forceVoice||object||For Talkify hosted voices, this is a JSON object with a name property. The value of name should be the name of a voice from /api/Voices. For browser voices, this is the actual voice from window.speechSynthesis.getVoices()|
Entry point: talkify.Html5Player().
|forceLanguage||string||Force the usage of a specific language. Use standard cultures like se-SE for Swedish and so on. Talkify will select a voice that matches the culture.|
|setRate||double||1||Playback rate. A value between 0.0 - 2.0|
|setVolume||double||1||Volume. A value between 0.0 - 1.0|
Entry point: talkify.TtsPlayer().
|setRate||int||1||Playback rate. A value between 1 and 3|
Please note that this library talks with a backend that is driven by personal fundings, therefore I intend to keep it free of charge until no longer possible. A rule of thumb: If you have a commersial product with heavy traffic, then a restriction or fee might be introduced to call the server.