This file contains the readily available functions which interact with the ITSLanguage speech recordings API.
Note that this is one of the "nested" or "composite" APIs; You can only obtain the data if you provide a reference to the challenge for which you want a recording.
- Source:
Methods
(static) create(challengeId, recording) → {Promise}
- Source:
Create a new speech recording.
Parameters:
| Name | Type | Description |
|---|---|---|
challengeId |
Object | The ID of the challenge to create a recording for. |
recording |
Object | The recording to create. |
Returns:
- The recording creation promise.
- Type
- Promise
(static) getAll(challenge, filtersopt) → {Promise}
- Source:
Get a all speech recordings.
By default all speech recordings are fetched though it is allowed to pass
filters as a URLSearchParams object.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
challenge |
string | The ID of the challenge for which the recording was made. |
|
filters |
URLSearchParams |
<optional> |
The filters to apply to the category list. |
Throws:
-
- If the given optional filters are not an instance of
URLSearchParams.
- If the given optional filters are not an instance of
- Type
- Promise.<string>
Returns:
- The promise for the speech recordings.
- Type
- Promise
(static) getById(challenge, id) → {Promise}
- Source:
Get a single speech recording by its ID.
Parameters:
| Name | Type | Description |
|---|---|---|
challenge |
string | The ID of the challenge for which the recording was made. |
id |
string | The ID of the desired speech recording. |
Returns:
- The promise for the speech recording.
- Type
- Promise
(static) record(challenge, recorder) → {Promise}
- Source:
Create a new recording for the given challenge with the data from the given recorder.
Parameters:
| Name | Type | Description |
|---|---|---|
challenge |
string | The ID of the challenge for which a recording is made. |
recorder |
MediaRecorder | The recorder to use to get the recording. |
Fires:
- {websocketserverreadyforaudio} - When the websocket server has been prepared for and is ready to receive the audio.event:
Returns:
- The promise which resolves once the speech recording has successfully been stored.
- Type
- Promise
(inner) url(challenge) → {string}
- Source:
The URL for the speech recording handler(s).
Parameters:
| Name | Type | Description |
|---|---|---|
challenge |
Returns:
- Type
- string