Domain name for API request: gme.tencentcloudapi.com.
This API is used to submit a voice detection task. Up to 100 tasks can be added in the detection task list. Before using this API, please activate the Voice Content Moderation Service in GME Console > Voice Content Moderation > Service Configuration.
When submitting a voice 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 |
---|---|---|
Voice detection | Voice detection type |
normal: Normal porn: Pornographic abuse: Abusive ad: Advertising illegal: Illegal moan: Moaning customized: Custom dictionary |
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 5000 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.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common Params. The value used for this API: ScanVoice. |
Version | Yes | String | Common Params. The value used for this API: 2018-07-11. |
Region | No | String | Common Params. This parameter is not required for this API. |
BizId | Yes | Integer | Application ID, which is obtained when you create an application in the GME console - Service Management. |
Scenes.N | Yes | Array of String | Voice detection scenario. It must be default . See the Label description as the result. |
Live | Yes | Boolean | Whether it is a live stream. Values: false (voice file), true (live stream). |
Tasks.N | Yes | Array of Task | Voice detection task list. Up to 100 tasks can be added in the list. DataId : Unique data IDUrl : URL-encoded data file URL, which is a pull address if the detected voice is a stream |
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 queried by calling the DescribeScanResultList API.) |
Lang | No | String | Language. Chinese will be used if it is left empty. |
Parameter Name | Type | Description |
---|---|---|
Data | Array of ScanVoiceResult | Voice moderation result. DataId : Corresponding DataId in request.TaskID : Moderation task ID, which is used to poll the voice detection result. |
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 voice detection task for a voice file where the callback address is empty and the DescribeScanResultList
API needs to be called to poll the detection result.
POST / HTTP/1.1
Host: gme.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ScanVoice
<Common request parameters>
{
"Callback": "https://0.0.0.0/user_callback",
"Live": "false",
"Tasks": [
{
"Url": "http://xxx/audio_store/xxxx.mp3",
"DataId": "1400000000_test_data_id"
}
],
"BizId": "1400000000",
"Scenes": [
"default"
]
}
{
"Response": {
"Data": [
{
"DataId": "1400000000_test_data_id",
"TaskId": "xxx-xxx-xxx"
}
],
"RequestId": "xxx-xxx-xxx"
}
}
This example shows you how to submit a voice detection task for a voice stream where the callback address is empty and the DescribeScanResultList
API needs to be called to poll the detection result.
POST / HTTP/1.1
Host: gme.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ScanVoice
<Common request parameters>
{
"Callback": "https://0.0.0.0/user_callback",
"Live": "true",
"Tasks": [
{
"Url": "https://xxxx",
"DataId": "1400000000_test_data_id"
}
],
"BizId": "1400000000",
"Scenes": [
"default"
]
}
{
"Response": {
"Data": [
{
"DataId": "1400000000_test_data_id",
"TaskId": "xxx-xxx-xxx"
}
],
"RequestId": "xxx-xxx-xxx"
}
}
This example shows you how to submit a voice detection task for a voice file where the callback address (Callback
) is set to query the detection result.
POST / HTTP/1.1
Host: gme.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ScanVoice
<Common request parameters>
{
"Callback": "https://0.0.0.0/user_callback",
"Live": "false",
"Tasks": [
{
"Url": "http://xxxx/audio_store/xxxx.mp3",
"DataId": "1400000000_test_data_id"
}
],
"BizId": "1400000000",
"Scenes": [
"default"
]
}
{
"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 | Parameter missing. |
OperationDenied | Operation denied. |
ResourceNotFound | The resource does not exist. |
ResourceUnavailable | The resource is unavailable. |
UnauthorizedOperation | Unauthorized operation. |
UnknownParameter | Unknown parameter error. |
UnsupportedOperation | Operation unsupported. |
本页内容是否解决了您的问题?