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
Extract audio from an `<audio>` or `<video>` element and transcribe speech.
46
+
47
+
This method has some limitations:
48
+
* the audio is run through two lossy conversions: first from the source format to WebAudio, and second to l16 (raw wav) for Watson
49
+
* the WebAudio API does not guarantee the same exact output for the same file played twice, so it's possible to receive slight different transcriptions for the same file played repeatedly
50
+
* it transcribes the audio as it is heard, so pausing or skipping will affect the transcription
51
+
* audio that is paused for too long will cause the socket to time out and disconnect, preventing further transcription (without setting things up again)
52
+
53
+
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.
54
+
43
55
Options:
44
56
*`element`: an `<audio>` or `<video>` element (could be generated pragmatically, e.g. `new Audio()`)
45
57
* Other options passed to MediaElementAudioStream and RecognizeStream
@@ -139,3 +151,4 @@ For use with `.recognizeBlob({play: true})` - slows the results down to match th
139
151
* consider a wrapper to match https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html
140
152
* consider renaming recognizeBlob to recognizeFile to make the usage more obvious
141
153
* consider an `interim` event for recognize/format/timing streams to avoid objectMode (in most cases)
0 commit comments