Skip to content

Commit 68735a3

Browse files
authored
Update closed-captions-teams-interop-android.md
Update code snippets, add models table and update format of doc.
1 parent 9d545f9 commit 68735a3

File tree

1 file changed

+53
-31
lines changed

1 file changed

+53
-31
lines changed

articles/communication-services/how-tos/calling-sdk/includes/closed-captions/closed-captions-teams-interop-android.md

Lines changed: 53 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,42 @@ ms.author: kpunjabi
1414
- Azure account with an active subscription, for details see [Create an account for free.](https://azure.microsoft.com/free/)
1515
- Azure Communication Services resource. See [Create an Azure Communication Services resource](../../../quickstarts/create-communication-resource.md?tabs=windows&pivots=platform-azp). Save the connection string for this resource.
1616
- An app with voice and video calling, refer to our [Voice](../../quickstarts/voice-video-calling/getting-started-with-calling.md) and [Video](../../quickstarts/voice-video-calling/get-started-with-video-calling.md) calling quickstarts.
17-
- [Access tokesn](../../quickstarts/manage-teams-identity.md) for Microsoft 365 users.
18-
- [Access tokesn](../../quickstarts/identity/access-tokens.md) for External identity users.
19-
- For Translated captions you will need to have a [Teams premium](https://www.microsoft.com/en-us/microsoft-teams/premium#tabx93f55452286a4264a2778ef8902fb81a) license.
17+
- [Access tokens](../../quickstarts/manage-teams-identity.md) for Microsoft 365 users.
18+
- [Access tokens](../../quickstarts/identity/access-tokens.md) for External identity users.
19+
- For Translated captions you will need to have a [Teams premium](/MicrosoftTeams/teams-add-on-licensing/licensing-enhance-teams#meetings) license.
2020

2121
>[!NOTE]
22-
>Please note that you will need to have a voice calling app using ACS calling SDKs to access the closed captions feature that is described in the quickstart below.
22+
>Please note that you will need to have a voice calling app using ACS calling SDKs to access the closed captions feature that is described in this guide.
2323
24-
## Join a Teams meeting
24+
## Models
25+
| Name | Description |
26+
|------|-------------|
27+
| TeamsCaptionsCallFeature | API for TeamsCall captions |
28+
| StartCaptionOptions | Closed caption options like spoken language |
29+
| TeamsCaptionsListener | Listener for addOnCaptionsReceivedListener |
30+
| TeamsCaptionsInfo | Data object received for each TeamsCaptionsListener event |
2531

26-
## Get captions feature for External Identity users
32+
## Get closed captions feature
33+
34+
### External Identity users
2735

2836
If you're building an application that allows ACS users to join a Teams meeting
2937

3038
``` java
3139
TeamsCaptionsCallFeature captionsCallFeature = call.feature(Features.TEAMS_CAPTIONS);
3240
```
3341

34-
## Get captions feature for Microsoft 365 users
42+
### Microsoft 365 users
43+
44+
If you're building an application for Microsoft 365 Users using ACS SDK.
3545

3646
``` java
3747
TeamsCaptionsCallFeature captionsCallFeature = teamsCall.feature(Features.TEAMS_CAPTIONS);
3848
```
3949

40-
## Add a listener to check if captions is active
50+
## Subscribe to listeners
51+
52+
### Add a listener to receive captions active/inactive status
4153

4254
``` java
4355
public void addOnIsCaptionsActiveChangedListener() {
@@ -49,7 +61,7 @@ public void addOnIsCaptionsActiveChangedListener() {
4961
}
5062
```
5163

52-
## Add listener for captions received
64+
### Add listener for captions data received
5365

5466
``` java
5567
TeamsCaptionsListener captionsListener = (TeamsCaptionsInfo captionsInfo) -> {
@@ -75,59 +87,69 @@ public void startCaptions() {
7587
}
7688
```
7789

78-
## Get supported spoken languages
90+
## Stop captions
91+
92+
``` java
93+
public void stopCaptions() {
94+
captionsCallFeature.stopCaptions().whenComplete((result, error) -> {
95+
if (error != null) {
96+
}
97+
});
98+
}
99+
```
100+
101+
## Remove caption received listener
102+
103+
``` java
104+
public void removeOnCaptionsReceivedListener() {
105+
captionsCallFeature.removeOnCaptionsReceivedListener(captionsListener);
106+
}
107+
```
108+
109+
## Spoken language support
110+
111+
### Get a list of supported spoken languages
79112

80113
Get a list of supported spoken languages that your users can select from when enabling closed captions.
81114

82115
``` java
116+
// bcp 47 formatted language code
83117
captionsCallFeature.getSupportedSpokenLanguages();
84118
```
85119

86-
## Set spoken language
120+
### Set spoken language
121+
87122
When the user selects the spoken language, your app can set the spoken language that it expects captions to be generated from.
88123

89124
``` java
90125
public void setSpokenLanguage() {
91-
captionsCallFeature.setSpokenLanguage(language).whenComplete((result, error) -> {
126+
captionsCallFeature.setSpokenLanguage("en-us").whenComplete((result, error) -> {
92127
if (error != null) {
93128
}
94129
});
95130
}
96131
```
97132

98-
## Get supported caption language
133+
## Caption language support
134+
135+
### Get supported caption language
99136

100137
If your organization has an active Teams premium license, then your ACS users can enable translated captions as long as the organizer of the meeting has a Teams premium license. As for users with Microsoft 365 identities this check will be done against their own user account if they meeting organizer doesn't have a Teams premium license.
101138

102139
``` java
140+
// ISO 639-1 formatted language code
103141
captionsCallFeature.getSupportedCaptionLanguages();
104142
```
105-
## Set caption languge
143+
### Set caption language
106144

107145
``` java
108146
public void setCaptionLanguage() {
109-
captionsCallFeature.setCaptionLanguage(language).whenComplete((result, error) -> {
147+
captionsCallFeature.setCaptionLanguage("en").whenComplete((result, error) -> {
110148
if (error != null) {
111149
}
112150
});
113151
}
114152
```
115153

116-
## Stop captions
117-
118-
``` java
119-
public void stopCaptions() {
120-
captionsCallFeature.stopCaptions().whenComplete((result, error) -> {
121-
if (error != null) {
122-
}
123-
});
124-
}
125-
```
126154

127-
## Remove caption received listener
128155

129-
``` java
130-
public void removeOnCaptionsReceivedListener() {
131-
captionsCallFeature.removeOnCaptionsReceivedListener(captionsListener);
132-
}
133-
```

0 commit comments

Comments
 (0)