startAudioDeviceRecordTest method

Future<int?> startAudioDeviceRecordTest(
  1. int interval
)

@detail api @brief Start the capture and playback test for local audio devices. @param interval During the test, you'll receive enableAudioPropertiesReport periodically. Set the period in ms with this parameter. Recommended value is 200 ms; the minimal value is 10 ms. @return result
- 0: success - < 0: failure @note - The audio capturing stops in 30s after calling this API and begins to play the recording audio. Before that, you can call stopAudioDeviceRecordAndPlayTest{@link #IRTCAudioDeviceManager#stopAudioDeviceRecordAndPlayTest} to stop audio capturing and start playing the recording audio. - Call stopAudioDevicePlayTest{@link #IRTCAudioDeviceManager#stopAudioDevicePlayTest} to stop the test, including capturing and playing the recording. - You must stop the test before starting another test for audio devices. - You must stop the test before calling enableAudioPropertiesReport. - This test performs locally and does not involve network connection testing.

Implementation

Future<int?> startAudioDeviceRecordTest(int interval) async {
  $a() => ($instance as $p_a.IRTCAudioDeviceManager)
      .startAudioDeviceRecordTest(interval);
  $i() => ($instance as $p_i.ByteRTCAudioDeviceManager)
      .startAudioDeviceRecordTest(interval);

  if (Platform.isAndroid) {
    return $a();
  } else if (Platform.isIOS) {
    return $i();
  } else {
    throw UnsupportedError(
        'Not Support Platform ${Platform.operatingSystem}');
  }
}