Module: watson-speech/speech-to-text/recognize-file

(require("watson-speech/speech-to-text/recognize-file"))(options) → {RecognizeStream|SpeakerStream|FormatStream|ResultStream|TimingStream}

Create and return a RecognizeStream from a File or Blob (e.g. from a file , a dragdrop target, or an ajax request)

Parameters:
Name Type Description
options Object

Also passed to {MediaElementAudioStream} and to {RecognizeStream}

Properties
Name Type Attributes Default Description
token String

Auth Token - see https://github.com/watson-developer-cloud/node-sdk#authorization

file Blob | FileString

String url or the raw audio data as a Blob or File instance to be transcribed (and optionally played). Playback may not with with Blob or File on mobile Safari.

play Boolean <optional>
false

If a file is set, play it locally as it's being uploaded

format Boolena <optional>
true

pipe the text through a {FormatStream} which performs light formatting. Also controls smart_formatting option unless explicitly set.

realtime Boolena <optional>
options.play

pipe the text through a {TimingStream} which slows the output down to real-time to match the audio playback.

outputElement String | DOMElement <optional>

pipe the text to a WriteableElementStream targeting the specified element. Also defaults objectMode to true to enable interim results.

extractResults Boolean <optional>
false

pipe results through a ResultExtractor stream to simplify the objects. (Default behavior before v0.22) Automatically enables objectMode.

resultsBySpeaker Boolean <optional>
false

pipe results through a SpeakerStream. Causes each data event to include multiple results, each with a speaker field. Automatically enables objectMode and speaker_labels. Adds some delay to processing.

Source:
Returns:
Type
RecognizeStream | SpeakerStream | FormatStream | ResultStream | TimingStream