Class: Transcriber

sound.Transcriber(options)

new Transcriber(options)

This manager handles the transcription of speech into text.

Parameters:
Name Type Description
options Object
Properties
Name Type Attributes Default Description
psychoJS module:core.PsychoJS the PsychoJS instance
name String the name used when logging messages
bufferSize number <optional>
10000 the maximum size of the circular transcript buffer
continuous Array.<String> <optional>
true whether or not to continuously recognise
lang Array.<String> <optional>
'en-US' the spoken language
interimResults Array.<String> <optional>
false whether or not to make interim results available
maxAlternatives Array.<String> <optional>
1 the maximum number of recognition alternatives
tokens Array.<String> <optional>
[] the tokens to be recognised. This is experimental technology, not available in all browser.
clock Clock <optional>
an optional clock
autoLog boolean <optional>
false whether or not to log
Source:
To Do:
  • deal with alternatives, interim results, and recognition errors

Methods

(protected) _onChange()

Callback for changes to the recognition settings.

Changes to the recognition settings require the recognition to stop and be re-started.

Source:

(protected) _prepareTranscription()

Prepare the transcription.
Source:

clearTranscripts()

Clear all transcripts and resets the circular buffers.
Source:

getTranscripts(options) → {Array.<Transcript>}

Get the list of transcripts still in the buffer, i.e. those that have not been previously cleared by calls to getTranscripts with clear = true.
Parameters:
Name Type Description
options Object
Properties
Name Type Attributes Default Description
transcriptList Array.<string> <optional>
[] the list of transcripts texts to consider. If transcriptList is empty, we consider all transcripts.
clear boolean <optional>
false whether or not to keep in the buffer the transcripts for a subsequent call to getTranscripts. If a keyList has been given and clear = true, we only remove from the buffer those keys in keyList
Source:
Returns:
the list of transcripts still in the buffer
Type
Array.<Transcript>

start() → {Promise}

Start the transcription.
Source:
Returns:
promise fulfilled when the transcription actually started
Type
Promise

stop() → {Promise}

Stop the transcription.
Source:
Returns:
promise fulfilled when the speech recognition actually stopped
Type
Promise