import SpeechRecordingController from 'itslanguage/administrative-sdk/speech-recording/speech-recording-controller.js'SpeechRecordingController
Controller class for the SpeechRecording model.
Constructor Summary
| Public Constructor | ||
| public |
constructor(connection: Connection) |
|
Member Summary
| Private Members | ||
| private |
_connection: * |
|
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 |
getSpeechRecordings(challengeId: string): Promise<SpeechRecording[]> Get and return all speech recordings in a specific speech challenge from the current active Organisation derived from the OAuth2 scope. |
|
| public |
startStreamingSpeechRecording(challenge: SpeechChallenge, recorder: AudioRecorder): Promise<SpeechRecording> Start a speech recording from streaming audio. |
|
| Private Methods | ||
| private |
speechRecordingInitAudio(recorder: AudioRecorder, dataavailableCb: Function): * Initialise the speech recording audio specs through RPCs. |
|
| private |
speechRecordingInitChallenge(challenge: SpeechChallenge): * Initialise the speech recording challenge through RPCs. |
|
Public Constructors
public constructor(connection: Connection) source
Params:
| Name | Type | Attribute | Description |
| 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.
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:
| Name | Type | Attribute | Description |
| challengeId | string | Specify a speech challenge identifier to list speech recordings for. |
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:
| Name | Type | Attribute | Description |
| challenge | SpeechChallenge | The speech challenge to perform. |
|
| recorder | AudioRecorder | The audio recorder to extract audio from. |
Return:
| Promise<SpeechRecording> | A https://github.com/cujojs/when Promise containing a SpeechRecording. |
Emit:
'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:
| Name | Type | Attribute | Description |
| recorder | AudioRecorder | AudioRecorder. |
|
| dataavailableCb | Function | Callback. |
Return:
| * |
private speechRecordingInitChallenge(challenge: SpeechChallenge): * source
Initialise the speech recording challenge through RPCs.
Params:
| Name | Type | Attribute | Description |
| challenge | SpeechChallenge | SpeechChallenge. |
Return:
| * |
