Submits an automatic speech recognition (ASR) job to extract the start and end time and the corresponding text information of a speech in a video.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ice:SubmitASRJob | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
InputFile | string | No | The input file. You can specify an Object Storage Service (OSS) URL or the ID of a media asset in the media asset library. | |
UserData | string | No | The user-defined data in the JSON format. You can specify your business information, such as the business environment and job information. | { "user": "data", "env": "prod" } |
Title | string | No | The job title, which can be up to 128 bytes in length. | |
Description | string | No | The job description, which can up to 128 bytes in length. | |
StartTime | string | No | The start time of the speech to recognize. | 00:00:00 |
Duration | string | No | The speech duration. | 00:00:10 |
Response parameters
You can call the GetSmartHandleJob operation to query the execution details of an ASR job. The following example shows the result returned by the GetSmartHandleJob operation for a successful job.
{
"RequestId": "******2D-443C-5043-B0E4-867070******",
"JobResult": {
"AiResult": "[{\"content\":\"Talking about\",\"from\":0.0,\"to\":0.846},{\"content\":\"he is now incredibly popular\",\"from\":0.846,\"to\":3.386},{\"content\":\"Although ticket prices are high\",\"from\":3.386,\"to\":4.402},{\"content\":\"his shows often sell out instantly\",\"from\":4.402,\"to\":6.265},{\"content\":\"In addition, he frequently appears on various comedy programs, where he judges performances by new comedians\",\"from\":6.265,\"to\":10.33}]"
},
"State": "Finished",
"Output": "[{\"content\":\"Talking about\",\"from\":0.0,\"to\":0.846},{\"content\":\"he is now incredibly popular\",\"from\":0.846,\"to\":3.386},{\"content\":\"Although ticket prices are high\",\"from\":3.386,\"to\":4.402},{\"content\":\"his shows often sell out instantly\",\"from\":4.402,\"to\":6.265},{\"content\":\"In addition, he frequently appears on various comedy programs, where he judges performances by new comedians\",\"from\":6.265,\"to\":10.33}]"
"JobId": "******042d5e4db6866f6289d1******",
"SmartJobInfo": {
"JobType": "ASR",
"ModifiedTime": "2022-01-21T06:15:08Z",
"UserId": 1234562230123456,
"CreateTime": "2022-01-21T06:15:02Z",
"Title": "default_title_2022-01-21T06:15:02Z",
"InputConfig": {
"JobParameters": "{\"duration\":\"00:30:00\",\"start_time\":\"00:00:00\",\"request_params\":\"&enable_word_level_result=true\"}",
"InputFile": "oss://your-bucket.oss-cn-shanghai.aliyuncs.com/your-video.mp4"
}
}
}
Examples
Sample success responses
JSON
format
{
"RequestId": "******11-DB8D-4A9A-875B-275798******",
"JobId": "****20b48fb04483915d4f2cd8ac****",
"State": "Finished"
}
Error codes
For a list of error codes, visit the Service error codes.