Skip to content

Commit 8092a96

Browse files
committed
readme touchup
1 parent bb9eb7a commit 8092a96

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,20 @@ Also note that Chrome requires https (with a few exceptions for localhost and su
3838

3939
Pipes results through a `{FormatStream}` by default, set `options.format=false` to disable.
4040

41+
Known issue: Firefox continues to display a microphone icon in the address bar even after recording has ceased. This is a browser bug.
42+
4143
### `.recognizeElement({element, token})` -> `RecognizeStream`
4244

45+
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+
4355
Options:
4456
* `element`: an `<audio>` or `<video>` element (could be generated pragmatically, e.g. `new Audio()`)
4557
* Other options passed to MediaElementAudioStream and RecognizeStream
@@ -139,3 +151,4 @@ For use with `.recognizeBlob({play: true})` - slows the results down to match th
139151
* consider a wrapper to match https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html
140152
* consider renaming recognizeBlob to recognizeFile to make the usage more obvious
141153
* consider an `interim` event for recognize/format/timing streams to avoid objectMode (in most cases)
154+
* ajax / playFile demo

0 commit comments

Comments
 (0)