你可以使用此接口查询指定音频切片任务的相关信息。
你可以调用GetSegmentTask接口,指定你所属的 AppId,查询指定 RoomId 下的音频切片任务。
自动切片任务也支持查询。
通过此接口仅能查询距今 72 小时内开始的音频切片任务。
关于调用接口的服务地址、通信协议、字符编码和签名机制,参看调用 OpenAPI。
QPS 不得超过 60。
使用 Get 方式发起请求。
以下是接口特有的请求参数。关于其他公共请求参数,参看请求参数。
| 参数名 | 类型 | 必填 | 示例值 | 描述 |
|---|---|---|---|---|
| Action | String | 是 | GetSegmentTask | 接口名称,本接口取值:GetSegmentTask |
| Version | String | 是 | 2022-06-01 | 接口版本,本接口取值:2022-06-01 |
| AppId | String | 是 | Your_AppId | 你的音视频应用的唯一标志 |
| RoomId | String | 是 | Your_RoomId | 房间的 ID,是房间的唯一标志 |
| TaskId | String | 否 | Your_TaskId | 要查询的音频切片任务 ID。自动切片任务下,该字段可传入用户 UserId。 |
https://rtc.volcengineapi.com?Action=GetSegmentTask&Version=2022-06-01&AppId=Your_AppId&RoomId=Your_RoomId&TaskId=Your_TaskId
返回结果参看 BaseResponse。
其中 Result 的结构如下:
| 参数名 | 类型 | 描述 |
|---|---|---|
| SegmentTask | SegmentTask | 音频切片任务信息 |
| 参数名 | 类型 | 描述 |
|---|---|---|
| StartTime | Uint64 | 任务开始时间戳,Unix 时间,单位为毫秒 |
| EndTime | Uint64 | 任务结束时间戳,Unix 时间,单位为毫秒。0 表示任务未结束 |
| Status | Uint64 | 任务状态。0: 未知异常状态1: 未开始 2: 运行中3: 已结束4: 任务运行失败 |
| StopReason | String | 任务停止的原因无:表示任务未结束UnknownStopReason:未知停止原因StopByAPI:用户主动调用 服务端 OpenAPI 停止StartTaskFailed:任务启动失败IdleTimeOut:任务超过最大空闲时间UserDisconnect:自动切片任务中,切片任务对应的客户端用户主动退房。 |
| MaxIdleTime | Unit32 | 任务最大的空闲超时时间。 |
| TargetStreams | Streams | 需要切片的音频流。 |
| Duration | Unit32 | 每个音频切片的时长。 |
| StorageConfig | StorageConfig | 存储平台设置。其中 AK、SK 字段不返回 |
| Control | Control(for segment) | 切片高级功能 |
| Identifier | String | 自定义文件前缀。 |
| Handle | Bool | 是否在开启音视频切片时,立刻开始切片。 |
{
"Result": {
"SegmentTask": {
"StartTime": 1677477732000,
"EndTime": 0,
"Status": 2,
"StopReason": "",
"TargetStreams": {
"StreamList": [
{
"Index": 0,
"UserId": "user0",
"StreamType": 0
},
{
"Index": 1,
"UserId": "user1",
"StreamType": 0
}
]
},
"Handle": true,
"Identifier": "getsegmenttask",
"MaxIdleTime": 600,
"Duration": 40,
"Control": {
"Align": true,
"Mixed": true,
"RedundantDuration": 3,
"IgnoreSilence": true
},
"StorageConfig": {
"Type": 0,
"TosConfig": {
"AccountId": "Your_AccountId",
"Region": 0,
"Bucket": "Your_Bucket"
},
"VodConfig": {
"Region": 0
},
"VeImageXConfig": {
"Region": 0
},
"CustomConfig": {
"Vendor": 0,
"Region": 0
}
}
}
},
"ResponseMetadata": {
"RequestId": "Your_RequestId",
"Action": "GetSegmentTask",
"Version": "2022-06-01"
}
}
json