DataStreamConfig

Data stream settings.

public class DataStreamConfig
    {
        public bool syncWithAudio;
        public bool ordered;
    }

The table below shows the SDK behavior for different parameter settings: syncWithAudio ordered SDK Behavior false false The SDK immediately triggers the OnStreamMessage callback upon receiving the data packet. true false If the data packet delay is within the audio delay range, the SDK triggers the OnStreamMessage callback synchronized with the audio packet during playback. If the delay exceeds the audio delay, the SDK triggers the callback immediately upon receiving the data packet; this may cause desynchronization between audio and data packets. false true If the data packet delay is within 5 seconds, the SDK corrects the out-of-order issue. If the delay exceeds 5 seconds, the SDK discards the data packet. true true If the data packet delay is within the audio delay range, the SDK corrects the out-of-order issue. If the delay exceeds the audio delay, the SDK discards the data packet.

Properties

syncWithAudio
Whether to synchronize with the locally sent audio stream.
  • true: The data stream is synchronized with the audio stream. This setting is suitable for special scenarios such as lyrics synchronization.
  • false: The data stream is not synchronized with the audio stream. This setting is suitable for scenarios where data packets need to reach the receiver immediately.
When synchronization is enabled, if the data packet delay is within the audio delay range, the SDK triggers the OnStreamMessage callback synchronized with the audio packet during playback.
ordered
Whether to ensure that received data is in the same order as sent.
  • true: The SDK outputs data packets in the same order as sent by the sender.
  • false: The SDK does not guarantee the order of data packets.
When data packets need to reach the receiver immediately, this parameter should not be set to true.