Skip to content

Commit 4b931df

Browse files
committed
new files/breakdowns
1 parent 47a4e9a commit 4b931df

File tree

4 files changed

+290
-0
lines changed

4 files changed

+290
-0
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
title: Include File for Real Time Text on Android
3+
description: Android how-to guide for Real Time Text feature.
4+
author: Adam Hammer
5+
ms.service: azure-communication-services
6+
ms.subservice: calling
7+
ms.topic: include
8+
ms.date: 10/24/2024
9+
ms.author: adam.hammer
10+
---
11+
12+
> [!NOTE]
13+
> Ensure that you have integrated the Calling Native SDK into your Android project before implementing Real Time Text.
14+
15+
## Models
16+
17+
| Name | Description |
18+
| ------------------ | ------------------------------------------------ |
19+
| `RealTimeTextInfo` | Represents a real-time text message entry, including sender information, message content, sequence ID, and status. |
20+
21+
## Get Real Time Text Feature
22+
23+
To access the Real Time Text feature, retrieve it from the `Call` object:
24+
25+
```java
26+
RealTimeTextCallFeature rttFeature = call.feature(Features.REAL_TIME_TEXT);
27+
```
28+
29+
## Feature Usage
30+
31+
### Sending Real Time Text Messages
32+
33+
Bind a text input field to the `send()` method to transmit messages as the user types:
34+
35+
```java
36+
EditText messageEditText = findViewById(R.id.messageEditText);
37+
messageEditText.addTextChangedListener(new TextWatcher() {
38+
@Override
39+
public void afterTextChanged(Editable s) {
40+
String text = s.toString();
41+
rttFeature.send(text);
42+
}
43+
// Other overridden methods...
44+
});
45+
```
46+
47+
### Receiving Real Time Text Messages
48+
49+
Subscribe to the `OnInfoReceived` event to handle incoming messages:
50+
51+
```java
52+
rttFeature.addOnInfoReceivedListener((eventArgs) -> {
53+
RealTimeTextInfo info = eventArgs.getInfo();
54+
55+
// Update your message list with the new info
56+
updateMessageList(info);
57+
58+
// Clear the text input if the message is local and finalized
59+
if (info.isLocal() && info.getResultType() == RealTimeTextResultType.FINAL) {
60+
messageEditText.getText().clear();
61+
}
62+
});
63+
```
64+
65+
## RealTimeTextInfo Class
66+
67+
The `RealTimeTextInfo` class provides detailed information about each real-time text message:
68+
69+
- **Sender**: Information about who sent the message.
70+
- **SequenceId**: Unique identifier for the message.
71+
- **Text**: The content of the message.
72+
- **ResultType**: Indicates if the message is partial or finalized.
73+
- **ReceivedTime**: Timestamp when the message was received.
74+
- **UpdatedTime**: Timestamp when the message was last updated.
75+
- **IsLocal**: Indicates if the message was sent by the local user.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
title: Include File for Real Time Text on iOS
3+
description: iOS how-to guide for Real Time Text feature.
4+
author: Adam Hammer
5+
ms.service: azure-communication-services
6+
ms.subservice: calling
7+
ms.topic: include
8+
ms.date: 10/24/2024
9+
ms.author: adam.hammer
10+
---
11+
12+
> [!NOTE]
13+
> Before implementing Real Time Text, ensure that the Calling Native SDK is properly integrated into your iOS project.
14+
15+
## Models
16+
17+
| Name | Description |
18+
| ------------------ | ------------------------------------------------ |
19+
| `RealTimeTextInfo` | Represents a real-time text message entry, including sender information, message content, sequence ID, and status. |
20+
21+
## Get Real Time Text Feature
22+
23+
Access the Real Time Text feature from your `Call` object:
24+
25+
```swift
26+
let rttFeature = call.feature(Features.realTimeText)
27+
```
28+
29+
## Feature Usage
30+
31+
### Sending Real Time Text Messages
32+
33+
Bind a text input field to the `send` method to transmit messages as the user types:
34+
35+
```swift
36+
@State var messageText: String = ""
37+
38+
TextField("Type your message", text: $messageText)
39+
.onChange(of: messageText) { newText in
40+
rttFeature?.send(newText)
41+
}
42+
```
43+
44+
### Receiving Real Time Text Messages
45+
46+
Subscribe to the `OnInfoReceived` event to handle incoming messages:
47+
48+
```swift
49+
rttFeature?.addOnInfoReceivedListener { eventArgs in
50+
if let info = eventArgs.info {
51+
// Update your message list with the new info
52+
updateMessageList(info)
53+
54+
// Clear the text input if the message is local and finalized
55+
if info.isLocal && info.resultType == .final {
56+
self.messageText = ""
57+
}
58+
}
59+
}
60+
```
61+
62+
## RealTimeTextInfo Class
63+
64+
The `RealTimeTextInfo` class provides detailed information about each real-time text message:
65+
66+
- **Sender**: Information about who sent the message.
67+
- **SequenceId**: Unique identifier for the message.
68+
- **Text**: The content of the message.
69+
- **ResultType**: Indicates if the message is partial or finalized.
70+
- **ReceivedTime**: Timestamp when the message was received.
71+
- **UpdatedTime**: Timestamp when the message was last updated.
72+
- **IsLocal**: Indicates if the message was sent by the local user.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
title: Include File for Real Time Text on Windows
3+
description: Windows how-to guide for Real Time Text feature.
4+
author: Adam Hammer
5+
ms.service: azure-communication-services
6+
ms.subservice: calling
7+
ms.topic: include
8+
ms.date: 10/24/2024
9+
ms.author: adam.hammer
10+
---
11+
12+
> [!NOTE]
13+
> Ensure that the Calling Native SDK is integrated into your Windows application before implementing Real Time Text.
14+
15+
## Models
16+
17+
| Name | Description |
18+
| ------------------ | ------------------------------------------------ |
19+
| `RealTimeTextDetails` | Represents a real-time text message entry, including sender information, message content, sequence ID, and status. |
20+
21+
## Get Real Time Text Feature
22+
23+
Retrieve the Real Time Text feature from the `Call` object:
24+
25+
```csharp
26+
RealTimeTextCallFeature rttFeature = call.GetRealTimeTextCallFeature();
27+
```
28+
29+
## Feature Usage
30+
31+
### Sending Real Time Text Messages
32+
33+
Connect a text input field to the `Send` method to transmit messages as the user types:
34+
35+
```csharp
36+
TextBox messageTextBox = new TextBox();
37+
messageTextBox.TextChanged += (sender, args) => {
38+
string text = messageTextBox.Text;
39+
rttFeature.Send(text);
40+
};
41+
```
42+
43+
### Receiving Real Time Text Messages
44+
45+
Subscribe to the `DetailsReceived` event to handle incoming messages:
46+
47+
```csharp
48+
rttFeature.DetailsReceived += (sender, e) => {
49+
RealTimeTextDetails details = e.Details;
50+
51+
// Update your message list with the new details
52+
UpdateMessageList(details);
53+
54+
// Clear the text input if the message is local and finalized
55+
if (details.IsLocal && details.Kind == RealTimeTextResultKind.Final) {
56+
messageTextBox.Text = string.Empty;
57+
}
58+
};
59+
```
60+
61+
## RealTimeTextDetails Class
62+
63+
The `RealTimeTextDetails` class provides comprehensive information about each real-time text message:
64+
65+
- **Sender**: Information about who sent the message.
66+
- **SequenceId**: Unique identifier for the message.
67+
- **Text**: The content of the message.
68+
- **Kind**: Indicates if the message is partial or finalized.
69+
- **ReceivedTime**: Timestamp when the message was received.
70+
- **UpdatedTime**: Timestamp when the message was last updated.
71+
- **IsLocal**: Indicates if the message was sent by the local user.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
title: Real Time Text
3+
titleSuffix: An Azure Communication Services how-to document
4+
description: Provides a how-to guide for the Real Time Text feature, enabling near-real-time text communication during calls.
5+
author: Adam Hammer
6+
ms.service: azure-communication-services
7+
ms.subservice: calling
8+
ms.topic: include
9+
ms.date: 10/24/2024
10+
ms.author: adamhammer
11+
ms.custom: private_preview
12+
services: azure-communication-services
13+
zone_pivot_groups: acs-plat-web-ios-android-windows
14+
---
15+
16+
# Real Time Text
17+
18+
Learn how to integrate Real Time Text (RTT) into your calling applications to enhance accessibility and ensure that all participants can communicate effectively during meetings.
19+
20+
RTT allows users who have difficulty speaking to participate actively by typing their messages, which are then broadcast in near real-time to other meeting participants. This feature operates seamlessly alongside existing captions and ensures that typed messages are promptly delivered without disrupting the flow of conversation.
21+
22+
23+
## Real Time Text Feature Overview
24+
25+
Real Time Text (RTT) is designed to facilitate communication for users who may have difficulty speaking during calls. By allowing users to type their messages, RTT ensures that everyone in the meeting can stay engaged and informed. Messages are transmitted over Data Channels (ID 24) and are always active, appearing automatically when the first message is sent.
26+
27+
On supported platforms, RTT data can be displayed alongside captions derived from Speech to Text, providing a comprehensive view of all communications during a call.
28+
29+
## Naming Conventions
30+
31+
Different platforms may use varying terminology for RTT-related properties. Below is a summary of these differences:
32+
33+
| Mobile (Android/iOS) | Windows (C#) |
34+
| -------------------- | ------------- |
35+
| **Type** | **Kind** |
36+
| **Info** | **Details** |
37+
38+
These aliases are functionally equivalent and are used to maintain consistency across different platforms.
39+
40+
## RealTimeTextInfo/Details Class
41+
42+
The `RealTimeTextInfo` (or `RealTimeTextDetails` on Windows) class encapsulates information about each RTT message. Below are the key properties:
43+
44+
| Property | Description |
45+
| ----------------- | ----------------------------------------------------- |
46+
| `SequenceId` | Unique identifier for the message sequence. |
47+
| `Text` | The content of the RTT message. |
48+
| `Sender` | Information about the sender of the message. |
49+
| `ResultType`/<br>`Kind` | Indicates whether the message is partial or final. |
50+
| `IsLocal` | Determines if the message was sent by the local user. |
51+
| `ReceivedTime` | Timestamp when the message was received. |
52+
| `UpdatedTime` | Timestamp when the message was last updated. |
53+
54+
55+
::: zone pivot="platform-android"
56+
[!INCLUDE [Real Time Text with Android](./includes/real-time-text/real-time-text-android.md)]
57+
::: zone-end
58+
59+
::: zone pivot="platform-ios"
60+
[!INCLUDE [Real Time Text with iOS](./includes/real-time-text/real-time-text-ios.md)]
61+
::: zone-end
62+
63+
::: zone pivot="platform-windows"
64+
[!INCLUDE [Real Time Text with Windows](./includes/real-time-text/real-time-text-windows.md)]
65+
::: zone-end
66+
67+
68+
## Next steps
69+
70+
For more information, see the following articles:
71+
72+
- [Azure Communication Services Calling Documentation](./calling-overview.md)

0 commit comments

Comments
 (0)