startAudioRecording method

Future<int?> startAudioRecording(
  1. AudioRecordingConfig config
)

@detail api @author huangshouqin @brief Starts recording audio communication, and generate the local file.
If you call this API before or after joining the room without internal audio capture, then the recording task can still begin but the data will not be recorded in the local files. Only when you call startAudioCapture{@link #RTCEngine#startAudioCapture} to enable internal audio capture, the data will be recorded in the local files. @param config See AudioRecordingConfig{@link #AudioRecordingConfig}. @return - 0: Success - -2: Invalid parameters - -3: Not valid in this SDK. Please contact the technical support. @note - All audio effects are valid in the file. Mixed audio file is not included in the file. - Call stopAudioRecording{@link #RTCEngine#stopAudioRecording} to stop recording. - You can call this API before and after joining the room. If this API is called before you join the room, you need to call stopAudioRecording{@link #RTCEngine#stopAudioRecording} to stop recording. If this API is called after you join the room, the recording task ends automatically. If you join multiple rooms, audio from all rooms are recorded in one file. - After calling the API, you'll receive onAudioRecordingStateUpdate{@link #IRTCEngineEventHandler#onAudioRecordingStateUpdate}.

Implementation

Future<int?> startAudioRecording(AudioRecordingConfig config) async {
  $a() => ($instance as $p_a.RTCEngine)
      .startAudioRecording(unpackObject<$p_a.AudioRecordingConfig>(config));
  $i() => ($instance as $p_i.ByteRTCEngine).startAudioRecording(
      unpackObject<$p_i.ByteRTCAudioRecordingConfig>(config));

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