Quickstart RTT within your application
Important
Functionality described in this article is currently in public preview. This preview version is provided without a service-level agreement, and we don't recommend it for production workloads. Certain features might not be supported or might have constrained capabilities. For more information, see Supplemental Terms of Use for Microsoft Azure Previews.
Note
RTT is an accessibility compliance requirement for voice and video platforms in the EU starting June 30, 2025. You can find more information about this here: Directive 2019/882.
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.
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.
Real Time Text Feature Overview
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.
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.
Note
RTT Teams Interlop is not functional yet.
Naming Conventions
Different platforms may use varying terminology for RTT-related properties. Below is a summary of these differences:
Mobile (Android/iOS) | Windows (C#) |
---|---|
Type | Kind |
Info | Details |
These aliases are functionally equivalent and are used to maintain consistency across different platforms.
RealTimeTextInfo/Details Class
The RealTimeTextInfo
(or RealTimeTextDetails
on Windows) class encapsulates information about each RTT message. Below are the key properties:
Property | Description |
---|---|
SequenceId |
Unique identifier for the message sequence. |
Text |
The content of the RTT message. |
Sender |
Information about the sender of the message. |
ResultType /Kind |
Indicates whether the message is partial or final. |
IsLocal |
Determines if the message was sent by the local user. |
ReceivedTime |
Timestamp when the message was received. |
UpdatedTime |
Timestamp when the message was last updated. |
Models
Name | Description |
---|---|
RealTimeTextInfo |
Represents a real-time text message entry, including sender information, message content, sequence ID, and status. |
Get Real Time Text Feature
To access the Real Time Text feature, retrieve it from the Call
object:
RealTimeTextCallFeature rttFeature = call.feature(Features.REAL_TIME_TEXT);
Feature Usage
Sending Real Time Text Messages
Bind a text input field to the send()
method to transmit messages as the user types:
EditText messageEditText = findViewById(R.id.messageEditText);
messageEditText.addTextChangedListener(new TextWatcher() {
@Override
public void afterTextChanged(Editable s) {
String text = s.toString();
rttFeature.send(text);
}
// Other overridden methods...
});
Receiving Real Time Text Messages
Subscribe to the OnInfoReceived
event to handle incoming messages:
rttFeature.addOnInfoReceivedListener((eventArgs) -> {
RealTimeTextInfo info = eventArgs.getInfo();
// Update your message list with the new info
updateMessageList(info);
// Clear the text input if the message is local and finalized
if (info.isLocal() && info.getResultType() == RealTimeTextResultType.FINAL) {
messageEditText.getText().clear();
}
});
RealTimeTextInfo Class
The RealTimeTextInfo
class provides detailed information about each real-time text message:
- Sender: Information about who sent the message.
- SequenceId: Unique identifier for the message.
- Text: The content of the message.
- ResultType: Indicates if the message is partial or finalized.
- ReceivedTime: Timestamp when the message was received.
- UpdatedTime: Timestamp when the message was last updated.
- IsLocal: Indicates if the message was sent by the local user.
Models
Name | Description |
---|---|
RealTimeTextInfo |
Represents a real-time text message entry, including sender information, message content, sequence ID, and status. |
Get Real Time Text Feature
Access the Real Time Text feature from your Call
object:
let rttFeature = call.feature(Features.realTimeText)
Feature Usage
Sending Real Time Text Messages
Bind a text input field to the send
method to transmit messages as the user types:
@State var messageText: String = ""
TextField("Type your message", text: $messageText)
.onChange(of: messageText) { newText in
rttFeature?.send(newText)
}
Receiving Real Time Text Messages
Subscribe to the OnInfoReceived
event to handle incoming messages:
rttFeature?.addOnInfoReceivedListener { eventArgs in
if let info = eventArgs.info {
// Update your message list with the new info
updateMessageList(info)
// Clear the text input if the message is local and finalized
if info.isLocal && info.resultType == .final {
self.messageText = ""
}
}
}
RealTimeTextInfo Class
The RealTimeTextInfo
class provides detailed information about each real-time text message:
- Sender: Information about who sent the message.
- SequenceId: Unique identifier for the message.
- Text: The content of the message.
- ResultType: Indicates if the message is partial or finalized.
- ReceivedTime: Timestamp when the message was received.
- UpdatedTime: Timestamp when the message was last updated.
- IsLocal: Indicates if the message was sent by the local user.
Models
Name | Description |
---|---|
RealTimeTextDetails |
Represents a real-time text message entry, including sender information, message content, sequence ID, and status. |
Get Real Time Text Feature
Retrieve the Real Time Text feature from the Call
object:
RealTimeTextCallFeature rttFeature = call.GetRealTimeTextCallFeature();
Feature Usage
Sending Real Time Text Messages
Connect a text input field to the Send
method to transmit messages as the user types:
TextBox messageTextBox = new TextBox();
messageTextBox.TextChanged += (sender, args) => {
string text = messageTextBox.Text;
rttFeature.Send(text);
};
Receiving Real Time Text Messages
Subscribe to the DetailsReceived
event to handle incoming messages:
rttFeature.DetailsReceived += (sender, e) => {
RealTimeTextDetails details = e.Details;
// Update your message list with the new details
UpdateMessageList(details);
// Clear the text input if the message is local and finalized
if (details.IsLocal && details.Kind == RealTimeTextResultKind.Final) {
messageTextBox.Text = string.Empty;
}
};
RealTimeTextDetails Class
The RealTimeTextDetails
class provides comprehensive information about each real-time text message:
- Sender: Information about who sent the message.
- SequenceId: Unique identifier for the message.
- Text: The content of the message.
- Kind: Indicates if the message is partial or finalized.
- ReceivedTime: Timestamp when the message was received.
- UpdatedTime: Timestamp when the message was last updated.
- IsLocal: Indicates if the message was sent by the local user.
Next steps
For more information, see the following articles: