startEchoTest method
@detail api
@author qipengxiang
@brief Starts a call test.
Before entering the room, you can call this API to test whether your local audio/video equipment as well as the upstream and downstream networks are working correctly.
Once the test starts, SDK will record your sound or video. If you receive the playback within the delay range you set, the test is considered normal.
@param echoConfig Test configurations, see ByteRTCEchoTestConfig{@link #ByteRTCEchoTestConfig}.
@param delayTime Delayed audio/video playback time specifying how long you expect to receive the playback after starting the. The range of the value is 2,10 in seconds and the default value is 2.
@return API call result:
- 0: Success
- -2: Failure due to parameter exception.
- -4: Failure because the user has joined a room.
- -6: Failure for the testing is in progress.
- -7: Failure for the request included neither video nor audio.
- -8: Failure for the roomID is already used.
@note
- Once you start the test, you can either call stopEchoTest{@link #ByteRTCEngine#stopEchoTest} or wait until the test stops automatically after 60s, to start the next test or enter the room.
- All APIs related to device control and stream control called before this API are invalidated during the test and are restored after the test.
- All APIs related to device control, stream control, and room entry called during the test do not take effect, and you will receive rtcEngine:onWarning:{@link #ByteRTCEngineDelegate#rtcEngine:onWarning} with the warning code
ByteRTCWarningCodeInEchoTestMode. - You will receive the test result from rtcEngine:onEchoTestResult:{@link #ByteRTCEngineDelegate#rtcEngine:onEchoTestResult}.
Implementation
FutureOr<int> startEchoTest(
ByteRTCEchoTestConfig echoConfig, NSInteger delayTime) async {
return await nativeCall(
'startEchoTest:playDelay:', [echoConfig, delayTime]);
}