Domain name for API request: gme.tencentcloudapi.com.
This API is used to submit a speech detection task. Up to 100 tasks can be added in the detection task list. Before using this API, please activate the speech analysis service in Console > Service Configuration.
When submitting a speech detection task, you need to specify the `Scenes` parameter. You are currently required to set the `Scenes` parameter to `["default"]`. The detection result will contain the scenario specified at the time of request and detection result in the corresponding type.
Scenario | Description | Label |
---|---|---|
Speech detection | Speech detection type |
normal: normal porn: pornographic abuse: abusive ad: advertising contraband: prohibited customized: custom keyword library. This feature is only available to beta users. To try it out, please contact us. |
Item | Type | Required | Description |
---|---|---|---|
Signatue | string | Yes | Signature. For more information, please see Signature generation description. |
{
"Code": 0,
"DataId": "1400000000_test_data_id",
"ScanFinishTime": 1566720906,
"HitFlag": true,
"Live": false,
"Msg": "",
"ScanPiece": [{
"DumpUrl": "",
"HitFlag": true,
"MainType": "abuse",
"RoomId": "123",
"OpenId": "xxx",
"Info":"",
"Offset": 0,
"Duration": 3400,
"PieceStartTime":1574684231,
"ScanDetail": [{
"EndTime": 1110,
"KeyWord": "xxx",
"Label": "abuse",
"Rate": "90.00",
"StartTime": 1110
}, {
"EndTime": 1380,
"KeyWord": "xxx",
"Label": "abuse",
"Rate": "90.00",
"StartTime": 930
}, {
"EndTime": 1560,
"KeyWord": "xxx",
"Label": "abuse",
"Rate": "90.00",
"StartTime": 930
}, {
"EndTime": 2820,
"KeyWord": "xxx",
"Label": "abuse",
"Rate": "90.00",
"StartTime": 2490
}]
}],
"ScanStartTime": 1566720905,
"Scenes": [
"default"
],
"Status": "Success",
"TaskId": "xxx",
"Url": "https://xxx/xxx.m4a"
}
A maximum of 1000 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
This document describes the parameters for Signature V1. It's recommended to use the V3 signature, which provides higher security. Note that for Signature V3, the common parameters need to be placed in the HTTP Header. See details.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common parameter. The value used for this API: ScanVoice. |
Version | Yes | String | Common parameter. The value used for this API: 2018-07-11. |
Region | No | String | Common parameter. This parameter is not required for this API. |
BizId | Yes | Integer | Application ID, which is the AppID obtained when you create an application in Console > Service Management |
Scenes.N | Yes | Array of String | Speech detection scenario. The value of this parameter is currently required to be default . Preset scenarios: abusive, pornographic, advertising, and other prohibited scenarios. For specific values, please see the Label description above. |
Live | Yes | Boolean | Whether it is a live stream. false: audio file detection, true: audio stream detection. |
Tasks.N | Yes | Array of Task | Speech detection task list. Up to 100 tasks can be added in the list. The structure contains: |
Callback | No | String | Async callback address for detection result. For more information, please see the callback description above. (Note: if this field is empty, the detection result can only be obtained by calling the DescribeScanResultList API.) |
Lang | No | String | The language. jp represents Japanese |
Parameter Name | Type | Description |
---|---|---|
Data | Array of ScanVoiceResult | Speech detection return. The Data field is a JSON array where each element contains: DataId in request. |
RequestId | String | The unique request ID, which is returned for each request. RequestId is required for locating a problem. |
This example shows you how to submit a speech detection task for an audio file where the callback address is empty and the DescribeScanResultList
API needs to be called to poll the detection result.
https://gme.tencentcloudapi.com/?Action=ScanVoice
&BizId=1400000000
&Scenes.0=default
&Live=false
&Callback=https://0.0.0.0/user_callback
&Tasks.0.DataId=1400000000_test_data_id
&Tasks.0.Url=http://xxx/audio_store/xxxx.mp3
&<common request parameters>
{
"Response": {
"Data": [
{
"DataId": "1400000000_test_data_id",
"TaskId": "xxx-xxx-xxx"
}
],
"RequestId": "xxx-xxx-xxx"
}
}
This example shows you how to submit a speech detection task for an audio stream where the callback address is empty and the DescribeScanResultList
API needs to be called to poll the detection result.
https://gme.tencentcloudapi.com/?Action=ScanVoice
&BizId=1400000000
&Scenes.0=default
&Live=true
&Callback=https://0.0.0.0/user_callback
&Tasks.0.DataId=1400000000_test_data_id
&Tasks.0.Url=https://xxxx
&<common request parameters>
{
"Response": {
"Data": [
{
"DataId": "1400000000_test_data_id",
"TaskId": "xxx-xxx-xxx"
}
],
"RequestId": "xxx-xxx-xxx"
}
}
This example shows you how to submit a speech detection task for an audio file where the callback address (Callback
) is set to get the detection result.
https://gme.tencentcloudapi.com/?Action=ScanVoice
&BizId=1400000000
&Scenes.0=default
&Live=false
&Callback=https://0.0.0.0/user_callback
&Tasks.0.DataId=1400000000_test_data_id
&Tasks.0.Url=http://xxxx/audio_store/xxxx.mp3
&<common request parameters>
{
"Response": {
"Data": [
{
"DataId": "1400000000_test_data_id",
"TaskId": "xxx-xxx-xxx"
}
],
"RequestId": "xxx-xxx-xxx"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Error Code | Description |
---|---|
FailedOperation | Operation failed. |
InternalError | Internal error. |
InvalidParameter | Incorrect parameter. |
InvalidParameter.CallbackAddress | Incorrect callback URL. |
MissingParameter | Missing parameter. |
OperationDenied | Operation denied. |
ResourceNotFound | The resource does not exist. |
ResourceUnavailable | The resource is unavailable |
UnauthorizedOperation | Unauthorized operation |
UnknownParameter | Unknown parameter. |
UnsupportedOperation | Operation unsupported. |
Was this page helpful?