setAudioAlignmentProperty method

FutureOr<int> setAudioAlignmentProperty(
  1. NSString streamId,
  2. ByteRTCAudioAlignmentMode mode
)

@detail api @hidden internal use only @author majun.lvhiei @brief On the listener side, set all subscribed audio streams precisely timely aligned. @param streamId ID of the remote audio stream used as the benchmark during time alignment.
You are recommended to use the audio stream from the lead singer.
You must call this API after receiving rtcRoom:onUserPublishStreamAudio:info:isPublish:{@link #ByteRTCRoomDelegate#rtcRoom:onUserPublishStreamAudio:info:isPublish}. @param mode Whether to enable the alignment. Disabled by default. See ByteRTCAudioAlignmentMode{@link #ByteRTCAudioAlignmentMode}. @return - 0: Success. - < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details @note - You must use the function when all participants set ByteRTCRoomProfile{@link #ByteRTCRoomProfile} to ByteRTCRoomProfileChorus when joining the room. - All remote participants must call startAudioMixing:filePath:config: to play background music and set syncProgressToRecordFrame of ByteRTCAudioMixingConfig to true. - If the subscribed audio stream is delayed too much, it may not be precisely aligned. - The chorus participants must not enable the alignment. If you wish to change the role from listener to participant, you should disable the alignment.

Implementation

FutureOr<int> setAudioAlignmentProperty(
    NSString streamId, ByteRTCAudioAlignmentMode mode) async {
  return await nativeCall(
      'setAudioAlignmentProperty:withMode:', [streamId, mode.$value]);
}