Skip to content

Commit b8bab2c

Browse files
committed
big improvements to jsdoc
1 parent 80ca404 commit b8bab2c

17 files changed

+426
-113
lines changed

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,33 @@ All API methods require an auth token that must be [generated server-side](https
3131

3232
## `Watson.TextToSpeech`
3333

34-
### '.synthesize({text, token})`
34+
### `.synthesize({text, token})` -> `<audio>`
3535

3636
Speaks the supplied text through an automatically-created `<audio>` element.
3737
Currently limited to text that can fit within a GET URL (this is particularly an issue on [Internet Explorer before Windows 10](http://stackoverflow.com/questions/32267442/url-length-limitation-of-microsoft-edge)
3838
where the max length is around 1000 characters after the token is accounted for.)
3939

4040
Options:
41-
* voice
41+
* text - the text to transcribe // todo: list supported languages
42+
* voice - the desired playback voice's name - see .getVoices(). Note that the voices are language-specific.
43+
* todo: autoPlay option that can be set to false to preload audio
44+
45+
### `.getVoices()` -> Promise
46+
47+
Returns a promise that resolves to an array of objects representing the available voices. Example:
48+
49+
```js
50+
[{
51+
"name": "en-US_MichaelVoice",
52+
"language": "en-US",
53+
"customizable": true,
54+
"gender": "male",
55+
"url": "https://stream.watsonplatform.net/text-to-speech/api/v1/voices/en-US_MichaelVoice",
56+
"description": "Michael: American English male voice."
57+
},
58+
//...
59+
]
60+
```
4261

4362
## `WatsonSpeech.SpeechToText`
4463

0 commit comments

Comments
 (0)