import PronunciationAnalysisController from 'itslanguage/administrative-sdk/pronunciation-analysis/pronunciation-analysis-controller.js'
PronunciationAnalysisController
Controller class for the PronunciationAnalysis model.
Static Method Summary
Static Private Methods | ||
private static |
_wordsToModels(inWords: object[]): Word[] Create a |
Constructor Summary
Public Constructor | ||
public |
constructor(connection: Connection) |
Member Summary
Private Members | ||
private |
Object to use for making a connection to the REST API and Websocket server. |
|
private |
|
Method Summary
Public Methods | ||
public |
getPronunciationAnalyses(challengeId: string, detailed: boolean): Promise<PronunciationAnalysis[]> Get and return all pronunciation analyses in a specific pronunciation challenge from the current active Organisation derived from the OAuth2 scope. |
|
public |
getPronunciationAnalysis(challengeId: string, analysisId: string): Promise<PronunciationAnalysis> Get a pronunciation analysis in a pronunciation challenge from the current active Organisation derived from the OAuth2 scope. |
|
public |
startStreamingPronunciationAnalysis(challenge: PronunciationChallenge, recorder: AudioRecorder, trim: boolean): Promise<PronunciationAnalysis> Start a pronunciation analysis from streaming audio. |
Private Methods | ||
private |
pronunciationAnalysisInitAudio(recorder: AudioRecorder, dataavailableCb: Function): * Initialise the pronunciation analysis audio specs through RPCs. |
|
private |
pronunciationAnalysisInitChallenge(challenge: PronunciationChallenge): * Initialise the pronunciation analysis challenge through RPCs. |
Static Private Methods
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: Connection source
Object to use for making a connection to the REST API and Websocket server.
private _referenceAlignment: * source
Public Methods
public getPronunciationAnalyses(challengeId: string, detailed: boolean): Promise<PronunciationAnalysis[]> source
Get and return all pronunciation analyses in a specific pronunciation challenge from the current active Organisation derived from the OAuth2 scope.
Throw:
Promise.<Error> |
PronunciationChallenge#id field is required. |
Promise.<Error> |
If no result could not be found. |
public getPronunciationAnalysis(challengeId: string, analysisId: string): Promise<PronunciationAnalysis> source
Get a pronunciation analysis in a pronunciation challenge from the current active Organisation derived from the OAuth2 scope.
Throw:
Promise.<Error> |
PronunciationChallenge#id field is required. |
Promise.<Error> |
PronunciationAnalysis#id field is required. |
Promise.<Error> |
If no result could not be found. |
public startStreamingPronunciationAnalysis(challenge: PronunciationChallenge, recorder: AudioRecorder, trim: boolean): Promise<PronunciationAnalysis> source
Start a pronunciation analysis from streaming audio.
Params:
Name | Type | Attribute | Description |
challenge | PronunciationChallenge | The pronunciation challenge to perform. |
|
recorder | AudioRecorder | The audio recorder to extract audio from. |
|
trim | boolean |
|
Whether to trim the start and end of recorded audio (default: true). |
Return:
Promise<PronunciationAnalysis> | A https://github.com/cujojs/when Promise containing a PronunciationAnalysis. |
Emit:
'ReadyToReceive' when the call is made to receive audio. The recorder can now send audio. |
|
When the sent audio has finished alignment. Aligning audio is the process of mapping the audio to spoken words and determining when what is said. An object is sent containing a property 'progress', which is the sent audio alignment, and a property 'referenceAlignment' which is the alignment of the reference audio. |
Throw:
Promise.<Error> |
challenge parameter of type "PronunciationChallenge" is required. |
Promise.<Error> |
challenge.id field of type "string" is required. |
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 analysis. |
Private Methods
private pronunciationAnalysisInitAudio(recorder: AudioRecorder, dataavailableCb: Function): * source
Initialise the pronunciation analysis audio specs through RPCs.
Params:
Name | Type | Attribute | Description |
recorder | AudioRecorder | AudioRecorder. |
|
dataavailableCb | Function | Callback. |
Return:
* |
private pronunciationAnalysisInitChallenge(challenge: PronunciationChallenge): * source
Initialise the pronunciation analysis challenge through RPCs.
Params:
Name | Type | Attribute | Description |
challenge | PronunciationChallenge | Challenge. |
Return:
* |