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
<title>File Promise Example - Watson Speech to Text</title>
6
+
</head>
7
+
<body>
8
+
9
+
<section>
10
+
<h2>Transcribe File, Comparing <code>{realtime: true}</code> to <code>{realtime: false}</code></h2>
11
+
<inputtype="file" id="audiofile"><buttonid="button">Transcribe and Play</button><buttonid="stop">Stop</button>
12
+
<p><small><i>Supported types are wav, ogg/opus (not ogg/vorbis), and flac. However, most browsers do not support flac.</i></small></p>
13
+
14
+
<h2><code>realtime: false</code> Output:</h2>
15
+
<divid="output">--</div>
16
+
17
+
<h2><code>realtime: true</code> Output:</h2>
18
+
<p><small><i>When transcription results are available faster than real-time (such as when simultaneously uploading and playing a file on a high-bandwidth connection), the TimingStream slows them down results to real-time.</i></small></p>
<p><small><i>When transcription results are available faster than real-time (such as when simultaneously uploading and playing a file on a high-bandwidth connection), the TimingStream slows them down results to real-time.</i></small></p>
Copy file name to clipboardExpand all lines: examples/public/index.html
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@
9
9
<li><ahref="microphone-streaming.html">Transcribe from Microphone, Streaming</a></li>
10
10
<li><ahref="microphone-streaming-auto-stop.html">Transcribe from Microphone, Streaming, automatically stop at first pause</a></li>
11
11
<li><ahref="file-streaming.html">Transcribe from file, Streaming</a></li>
12
+
<li><ahref="blob-realtime-vs-no-realtime.html">Transcribe from file, Comparing <code>{realtime: true}</code> to <code>{realtime: false}</code></a></li>
12
13
<li><ahref="file-promise.html">Transcribe from file, Promise</a></li>
13
14
<li><ahref="audio-element.html">Transcribe from HTML5 <audio> element, Streaming</a></li>
14
15
<li><ahref="audio-element-programmatic.html">Transcribe from <code>new Audio()</code>, Streaming</a></li>
* Create and return a RecognizeStream from a File or Blob
@@ -27,7 +28,9 @@ var FilePlayer = require('./file-player.js');
27
28
* @param {Object} options - Also passed to {MediaElementAudioStream} and to {RecognizeStream}
28
29
* @param {String} options.token - Auth Token - see https://github.com/watson-developer-cloud/node-sdk#authorization
29
30
* @param {Blob|File} options.data - the raw audio data as a Blob or File instance
30
-
* @param {Boolean} [options.play=true] - If a file is set, play it locally as it's being uploaded
31
+
* @param {Boolean} [options.play=false] - If a file is set, play it locally as it's being uploaded
32
+
* @param {Boolena} [options.format=true] - pipe the text through a {FormatStream} which performs light formatting
33
+
* @param {Boolena} [options.realtime=options.play] - pipe the text through a {TimingStream} which slows the output down to real-time to match the audio playback.
31
34
*
32
35
* @returns {RecognizeStream}
33
36
*/
@@ -36,17 +39,26 @@ module.exports = function recognizeBlob(options) {
0 commit comments