Agora Java API Reference for Android

Public Attributes | List of all members
agora::rtc::DataStreamConfig Struct Reference

`#include <AgoraBase.h>`

## Public Attributes
bool | syncWithAudio
bool | ordered

## Detailed Description

The configurations for the data stream.

## Member Data Documentation

## ◆ syncWithAudio

bool agora::rtc::DataStreamConfig::syncWithAudio

Whether to synchronize the data packet with the published audio packet.

- `true`: Synchronize the data packet with the audio packet.
- `false`: Do not synchronize the data packet with the audio packet.

When you set the data packet to synchronize with the audio, then if the data packet delay is within the audio delay, the SDK triggers the `onStreamMessage` callback when the synchronized audio packet is played out. Do not set this parameter as true if you need the receiver to receive the data packet immediately. Agora recommends that you set this parameter to `true` only when you need to implement specific functions, for example lyric synchronization.

## ◆ ordered

bool agora::rtc::DataStreamConfig::ordered

Whether the SDK guarantees that the receiver receives the data in the sent order.

- `true`: Guarantee that the receiver receives the data in the sent order.
- `false`: Do not guarantee that the receiver receives the data in the sent order.

Do not set this parameter as `true` if you need the receiver to receive the data packet immediately.