startAudioRecording [1/3]

Starts audio recording on the client.

virtual int startAudioRecording(const char* filePath, AUDIO_RECORDING_QUALITY_TYPE quality) = 0;


Attention: The sample rate of recording is 32 kHz by default and cannot be modified.
The Agora SDK allows recording during a call. This method records the audio of all the users in the channel and generates an audio recording file. Supported formats of the recording file are as follows:
  • .wav: Large file size with high fidelity.
  • .aac: Small file size with low fidelity.

Ensure that the directory for the recording file exists and is writable. This method should be called after the joinChannel [2/2] method. The recording automatically stops when you call the leaveChannel [2/2] method.


The absolute path (including the filename extensions) of the recording file. For example: C:\music\audio.aac.

Ensure that the directory for the log files exists and is writable.

Audio recording quality. See AUDIO_RECORDING_QUALITY_TYPE.


  • 0: Success.
  • < 0: Failure.