You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"description":"Michael: American English male voice."
57
-
},
58
-
//...
59
-
]
60
-
```
47
+
Returns a promise that resolves to an array of objects containing the name, language, gender, and other details for each voice.
48
+
49
+
Requires[window.fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API), a [pollyfill](https://www.npmjs.com/package/whatwg-fetch) for IE/Edge and older Chrome/Firefox.
Options: No direct options, all provided options are passed to MicrophoneStream and RecognizeStream
56
+
Options: No direct options, all provided options are passed to MicrophoneStream and RecognizeStream, and WritableElementStream if `options.outputElement` is set
68
57
69
58
Requires the `getUserMedia` API, so limited browser compatibility (see http://caniuse.com/#search=getusermedia)
70
59
Also note that Chrome requires https (with a few exceptions for localhost and such) - see https://www.chromium.org/Home/chromium-security/prefer-secure-origins-for-powerful-new-features
@@ -88,6 +77,7 @@ Because of these limitations, it may be preferable to instead fetch the audio vi
88
77
Options:
89
78
*`element`: an `<audio>` or `<video>` element (could be generated pragmatically, e.g. `new Audio()`)
90
79
* Other options passed to MediaElementAudioStream and RecognizeStream
80
+
* Other options passed to WritableElementStream if `options.outputElement` is set
91
81
92
82
Requires that the browser support MediaElement and whatever audio codec is used in your media file.
93
83
@@ -101,6 +91,7 @@ Options:
101
91
*`data`: a `Blob` (or `File`) instance.
102
92
*`play`: (optional, default=`false`) Attempt to also play the file locally while uploading it for transcription
103
93
* Other options passed to RecognizeStream
94
+
* Other options passed to WritableElementStream if `options.outputElement` is set
104
95
105
96
`play`requires that the browser support the format; most browsers support wav and ogg/opus, but not flac.)
106
97
Will emit a `playback-error` on the RecognizeStream if playback fails.
@@ -152,9 +143,17 @@ Inherits `.promise()` from the `RecognizeStream`.
152
143
153
144
For use with `.recognizeBlob({play: true})` - slows the results down to match the audio. Pipe in the `RecognizeStream` (or `FormatStream`) and listen for results as usual.
154
145
146
+
### Class `WritableElementStream()`
147
+
148
+
Accepts input from `RecognizeStream()` and friends, writes text to supplied `outputElement`.
149
+
155
150
156
151
## Changelog
157
152
153
+
### v0.10
154
+
* Added ability to write text directly to targetElement, updated examples to use this
155
+
* converted examples from jQuery to vanilla JS + fetch pollyfill
156
+
158
157
### v0.9
159
158
* Added basic text to speech support
160
159
@@ -187,3 +186,5 @@ For use with `.recognizeBlob({play: true})` - slows the results down to match th
187
186
* consider renaming recognizeBlob to recognizeFile to make the usage more obvious
188
187
* consider an `interim` event for recognize/format/timing streams to avoid objectMode (in most cases)
189
188
* ajax / playFile demo
189
+
* support a "hard" stop that prevents any further data events, even for already uploaded audio, ensure timing stream also impliments this.
190
+
* handle pause/resume in media element streams - perhaps just stop and then create a new stream on resume
0 commit comments