Skip to content

Commit

Permalink
added more examples for listing voices in readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenlb committed Aug 4, 2018
1 parent 20bc6b0 commit 1c7907c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spoken",
"version": "1.1.14",
"version": "1.1.15",
"license": "MIT",
"author": "Stephen Blum",
"description": "JavaScript Web API for Text-to-Speech and Speech-to-Text.",
Expand Down
17 changes: 13 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ How to build a
[voice-controlled intelligent chatbot](https://www.pubnub.com/blog/build-an-80s-chatbot-with-an-npm-package/)
who comprehends human speech and responses accordingly and naturally!

### Add Voice Contorl to your OBS Twitch and YouTube Live Streams
### Add Voice Controls to your OBS Twitch and YouTube Live Streams

Learn how we [built an OBS
Plugin that adds Subtitles to your
Expand Down Expand Up @@ -160,7 +160,12 @@ await spoken.say('Hello World.');
console.log('Done talking.');
```

### Text-to-Speech Voice Library
### Text-to-Speech Voice Selection Library

Synthetic voices are selectable using the `spoken.voices` method.
There is a default voice that is included.
You may want to pick a different voice.
The following examples show you how to select a differnt voice.

```javascript
// List of voices supported on platform
Expand All @@ -173,8 +178,12 @@ spoken.voices().then( voices => console.log(voices) );
Get list of **English** voices.

```javascript
// List English Speaking Voices
(await spoken.voices()).filter( v => v.lang.indexOf('en') == 0 );
// List of English Speaking Voices
spoken.recognition.language = navigator.language || 'en-US';
let voices = (await spoken.voices()).filter( v => !v.lang.indexOf('en') );

// Use the First Voice
spoken.say( 'Welcome to flavor town.', voices[0] );
```

Sample the list of English voices.
Expand Down

0 comments on commit 1c7907c

Please sign in to comment.