Skip to content

Commit acc7e70

Browse files
committed
mentioning native subtitles support as an alternative for recognizeElement
1 parent 04a8050 commit acc7e70

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ This method has some limitations:
7676
* it transcribes the audio as it is heard, so pausing or skipping will affect the transcription
7777
* audio that is paused for too long will cause the socket to time out and disconnect, preventing further transcription (without setting things up again)
7878

79-
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.
79+
Because of these limitations, there are two alternative methods that may be preferable in some situations:
80+
* fetch the audio via ajax and then pass it to `recognizeFile()` - this resolves the issues around lossy conversion and inexact transcription, but the audio playback, if enabled, cannot be paused, rewound, etc.
81+
* Pre-process the audio and generate a [WebVTT](https://developer.mozilla.org/en-US/docs/Web/API/Web_Video_Text_Tracks_Format) subtitles file to insert in `<track>`, completely bypassing this SDK. This resolves all of the above issues, and gives you an opportunity to review and/or edit the subtitles if desired.
8082

8183
Options:
8284
* `element`: an `<audio>` or `<video>` element (could be generated pragmatically, e.g. `new Audio()`)

0 commit comments

Comments
 (0)