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
Copy file name to clipboardExpand all lines: README.md
+17-6Lines changed: 17 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,7 @@ This method has some limitations:
72
72
* it transcribes the audio as it is heard, so pausing or skipping will affect the transcription
73
73
* audio that is paused for too long will cause the socket to time out and disconnect, preventing further transcription (without setting things up again)
74
74
75
-
Because of these limitations, it may be preferable to instead fetch the audio via ajax and then pass it the `recognizeBlob()` API in some situations.
75
+
Because of these limitations, it may be preferable to instead fetch the audio via ajax and then pass it the `recognizeFile()` API in some situations.
76
76
77
77
Options:
78
78
*`element`: an `<audio>` or `<video>` element (could be generated pragmatically, e.g. `new Audio()`)
@@ -85,10 +85,13 @@ Will automatically call `.play()` the `element`, set `options.autoPlay=false` to
85
85
86
86
Pipes results through a `{FormatStream}` by default, set `options.format=false` to disable.
Can recognize and optionally attempt to play a [File](https://developer.mozilla.org/en-US/docs/Web/API/File) or [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob)
91
+
(such as from an `<input type="file"/>` or from an ajax request.)
89
92
90
93
Options:
91
-
*`data`: a `Blob`(or `File`) instance.
94
+
*`data`: a `Blob` or `File` instance.
92
95
*`play`: (optional, default=`false`) Attempt to also play the file locally while uploading it for transcription
93
96
* Other options passed to RecognizeStream
94
97
* Other options passed to WritableElementStream if `options.outputElement` is set
@@ -141,7 +144,9 @@ Inherits `.promise()` from the `RecognizeStream`.
141
144
142
145
### Class `TimingStream()`
143
146
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.
147
+
For use with `.recognizeFile({play: true})` - slows the results down to match the audio. Pipe in the `RecognizeStream` (or `FormatStream`) and listen for results as usual.
148
+
149
+
Inherits `.promise()` from the `RecognizeStream`.
145
150
146
151
### Class `WritableElementStream()`
147
152
@@ -150,6 +155,13 @@ Accepts input from `RecognizeStream()` and friends, writes text to supplied `out
150
155
151
156
## Changelog
152
157
158
+
### v0.11
159
+
* renamed `recognizeBlob` to `recognizeFile` to make the primary usage more apparent
160
+
* Added support for `<input>` and `<textarea>` elements when using the `targetElement` option (or a `WritableElementStream`)
161
+
* For objectMode, changed defaults for `word_confidence` to `false`, `alternatives` to `1`, and `timing` to off unless required for `realtime` option.
162
+
* Fixed bug with calling `.promise()` on `objectMode` streams
163
+
* Fixed bug with calling `.promise()` on `recognizeFile({play: true})`
164
+
153
165
### v0.10
154
166
* Added ability to write text directly to targetElement, updated examples to use this
155
167
* converted examples from jQuery to vanilla JS (w/ fetch pollyfill when necessary)
@@ -174,7 +186,6 @@ Accepts input from `RecognizeStream()` and friends, writes text to supplied `out
174
186
## todo
175
187
176
188
* Solidify API
177
-
* add an ajax / recognizeBlob example and then use it for stt sample app
0 commit comments