命名空间:microsoft.graph
重要
Microsoft Graph版本下的 /beta API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
配置多方对话中不同参与者的音频混合方式。
Permissions
要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限。
| 权限类型 |
权限(从最低特权到最高特权) |
| 委派(工作或学校帐户) |
不支持 |
| 委派(个人 Microsoft 帐户) |
不支持 |
| Application |
Calls.JoinGroupCallsasGuest.All、Calls.JoinGroupCalls.All、Calls.InitiateGroupCalls.All |
HTTP 请求
POST /app/calls/{id}/participants/configureMixer
POST /communications/calls/{id}/participants/configureMixer
注意:/app 路径已弃用。 今后将使用 /communications 路径。
| 名称 |
说明 |
| Authorization |
Bearer {token}。必需。 |
请求正文
在请求正文中,提供具有以下参数的 JSON 对象。
| 参数 |
类型 |
Description |
| participantMixerLevels |
participantMixerLevel 集合 |
给定音频参与者的调频器级别配置。 |
| clientContext |
String |
客户端上下文。 |
响应
返回 202 Accepted 响应代码和具有为此请求创建的 commsOperation 的 uri 的位置标头。
示例
以下示例演示如何调用此 API。
请求
下面为请求示例。
POST https://graph.microsoft.com/beta/communications/calls/{id}/participants/configureMixer
Content-Type: application/json
Content-Length: 501
{
"clientContext": "d45324c1-fcb5-430a-902c-f20af696537c",
"participantMixerLevels": [
{
"participant": "550fae72-d251-43ec-868c-373732c2704f",
"exclusive": true,
"ducking": {
"rampActive": 50,
"rampInactive": 50,
"lowerLevel": 10,
"upperLevel": 50
},
"sourceLevels": [
{
"participant": "632899f8-2ea1-4604-8413-27bd2892079f",
"level": 50,
"duckOthers": false
}
]
}
]
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var clientContext = "d45324c1-fcb5-430a-902c-f20af696537c";
var participantMixerLevels = new List<ParticipantMixerLevel>()
{
new ParticipantMixerLevel
{
Participant = "550fae72-d251-43ec-868c-373732c2704f",
Exclusive = true,
Ducking = new AudioDuckingConfiguration
{
RampActive = 50,
RampInactive = 50,
LowerLevel = 10,
UpperLevel = 50
},
SourceLevels = new List<AudioSourceLevel>()
{
new AudioSourceLevel
{
Participant = "632899f8-2ea1-4604-8413-27bd2892079f",
Level = 50,
DuckOthers = false
}
}
}
};
await graphClient.App.Calls["{id}"].Participants
.ConfigureMixer(participantMixerLevels,clientContext)
.Request()
.PostAsync();
const options = {
authProvider,
};
const client = Client.init(options);
const participant = {
clientContext: 'd45324c1-fcb5-430a-902c-f20af696537c',
participantMixerLevels: [
{
participant: '550fae72-d251-43ec-868c-373732c2704f',
exclusive: true,
ducking: {
rampActive: 50,
rampInactive: 50,
lowerLevel: 10,
upperLevel: 50
},
sourceLevels: [
{
participant: '632899f8-2ea1-4604-8413-27bd2892079f',
level: 50,
duckOthers: false
}
]
}
]
};
await client.api('/communications/calls/{id}/participants/configureMixer')
.version('beta')
.post(participant);
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/app/calls/{id}/participants/configureMixer"]]];
[urlRequest setHTTPMethod:@"POST"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSMutableDictionary *payloadDictionary = [[NSMutableDictionary alloc] init];
NSString *clientContext = @"d45324c1-fcb5-430a-902c-f20af696537c";
payloadDictionary[@"clientContext"] = clientContext;
NSMutableArray *participantMixerLevelsList = [[NSMutableArray alloc] init];
MSGraphParticipantMixerLevel *participantMixerLevels = [[MSGraphParticipantMixerLevel alloc] init];
[participantMixerLevels setParticipant:@"550fae72-d251-43ec-868c-373732c2704f"];
[participantMixerLevels setExclusive: true];
MSGraphAudioDuckingConfiguration *ducking = [[MSGraphAudioDuckingConfiguration alloc] init];
[ducking setRampActive: 50];
[ducking setRampInactive: 50];
[ducking setLowerLevel: 10];
[ducking setUpperLevel: 50];
[participantMixerLevels setDucking:ducking];
NSMutableArray *sourceLevelsList = [[NSMutableArray alloc] init];
MSGraphAudioSourceLevel *sourceLevels = [[MSGraphAudioSourceLevel alloc] init];
[sourceLevels setParticipant:@"632899f8-2ea1-4604-8413-27bd2892079f"];
[sourceLevels setLevel: 50];
[sourceLevels setDuckOthers: false];
[sourceLevelsList addObject: sourceLevels];
[participantMixerLevels setSourceLevels:sourceLevelsList];
[participantMixerLevelsList addObject: participantMixerLevels];
payloadDictionary[@"participantMixerLevels"] = participantMixerLevelsList;
NSData *data = [NSJSONSerialization dataWithJSONObject:payloadDictionary options:kNilOptions error:&error];
[urlRequest setHTTPBody:data];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.New()
requestBody.SetAdditionalData(map[string]interface{}{
"clientContext": "d45324c1-fcb5-430a-902c-f20af696537c",
"participantMixerLevels": []Object {
}
}
callId := "call-id"
participantId := "participant-id"
graphClient.Communications().CallsById(&callId).ParticipantsById(&participantId).Post(requestBody)
响应
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Location: https://graph.microsoft.com/beta/communications/calls/57dab8b1-894c-409a-b240-bd8beae78896/operations/0fe0623f-d628-42ed-b4bd-8ac290072cc5
{
"@odata.type": "#microsoft.graph.commsOperation",
"clientContext": "clientContext-value",
"id": "0fe0623f-d628-42ed-b4bd-8ac290072cc5",
"resultInfo": null,
"status": "running"
}
通知 - 操作已完成
POST https://bot.contoso.com/api/calls
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.commsNotifications",
"value": [
{
"@odata.type": "#microsoft.graph.commsOperation",
"changeType": "deleted",
"resourceUrl": "/communications/calls/57dab8b1-894c-409a-b240-bd8beae78896/operations/0fe0623f-d628-42ed-b4bd-8ac290072cc5",
"resourceData": {
"@odata.type": "#microsoft.graph.commsOperation",
"@odata.id": "/communications/calls/57dab8b1-894c-409a-b240-bd8beae78896/operations/0fe0623f-d628-42ed-b4bd-8ac290072cc5",
"@odata.etag": "W/\"1\"",
"clientContext": "d45324c1-fcb5-430a-902c-f20af696537c",
"status": "completed"
}
}
]
}