Home Manual Reference Source
private class | source

SpeechRecordingController

Controller class for the SpeechRecording model.

Constructor Summary

Public Constructor
public

constructor(connection: Connection)

Member Summary

Private Members
private

Method Summary

Public Methods
public

getSpeechRecording(challengeId: string, recordingId: string): Promise<SpeechRecording>

Get a speech recording in a speech challenge from the current active Organisation derived from the OAuth2 scope.

public

Get and return all speech recordings in a specific speech challenge from the current active Organisation derived from the OAuth2 scope.

public

Start a speech recording from streaming audio.

Private Methods
private

speechRecordingInitAudio(recorder: AudioRecorder, dataavailableCb: Function): *

Initialise the speech recording audio specs through RPCs.

private

Initialise the speech recording challenge through RPCs.

Public Constructors

public constructor(connection: Connection) source

Params:

NameTypeAttributeDescription
connection Connection

Object to use for making a connection to the REST API and Websocket server.

Private Members

private _connection: * source

Public Methods

public getSpeechRecording(challengeId: string, recordingId: string): Promise<SpeechRecording> source

Get a speech recording in a speech challenge from the current active Organisation derived from the OAuth2 scope.

Params:

NameTypeAttributeDescription
challengeId string

Specify a speech challenge identifier.

recordingId string

Specify a speech recording identifier.

Return:

Promise<SpeechRecording>

Promise containing a SpeechRecording.

Throw:

Promise.<Error>

SpeechChallenge#id field is required.

Promise.<Error>

SpeechRecording#id field is required.

Promise.<Error>

If no result could not be found.

public getSpeechRecordings(challengeId: string): Promise<SpeechRecording[]> source

Get and return all speech recordings in a specific speech challenge from the current active Organisation derived from the OAuth2 scope.

Params:

NameTypeAttributeDescription
challengeId string

Specify a speech challenge identifier to list speech recordings for.

Return:

Promise<SpeechRecording[]>

Promise containing an array of SpeechRecording.

Throw:

Promise.<Error>

SpeechChallenge#id is required.

Promise.<Error>

If no result could not be found.

public startStreamingSpeechRecording(challenge: SpeechChallenge, recorder: AudioRecorder): Promise<SpeechRecording> source

Start a speech recording from streaming audio.

Params:

NameTypeAttributeDescription
challenge SpeechChallenge

The speech challenge to perform.

recorder AudioRecorder

The audio recorder to extract audio from.

Emit:

string

'ReadyToReceive' when the call is made to receive audio. The recorder can now send audio.

Throw:

Promise.<Error>

If challenge is not an object or not defined.

Promise.<Error>

If challenge has no id.

Promise.<Error>

If the connection is not open.

Promise.<Error>

If the recorder is already recording.

Promise.<Error>

If a session is already in progress.

Promise.<Error>

If something went wrong during recording.

Private Methods

private speechRecordingInitAudio(recorder: AudioRecorder, dataavailableCb: Function): * source

Initialise the speech recording audio specs through RPCs.

Params:

NameTypeAttributeDescription
recorder AudioRecorder

AudioRecorder.

dataavailableCb Function

Callback.

Return:

*

private speechRecordingInitChallenge(challenge: SpeechChallenge): * source

Initialise the speech recording challenge through RPCs.

Params:

NameTypeAttributeDescription
challenge SpeechChallenge

SpeechChallenge.

Return:

*