startAudioCapture abstract method

Future<int?> startAudioCapture()

Starts internal audio capturing. Off by default.

Internal capture refers to audio capture using the built-in capture module of the SDK.
After this API is called, the local user will receive RTCVideoEventHandler.onAudioDeviceStateChanged.
If this API is called by a visible user in the current room, the other users in the room will receive RTCVideoEventHandler.onUserStartAudioCapture.

Return value:

Notes:

  • Calling this API without obtaining permission to use the microphone of the current device will trigger RTCVideoEventHandler.onAudioDeviceStateChanged with MediaDeviceError.deviceNoPermission.
  • Call RTCVideo.stopAudioCapture to stop the internal audio capturing, otherwise it will not stop until the engine is destroyed.
  • Since different hardware devices have different initialization response times, frequent calls to this method and RTCVideo.stopAudioCapture may cause short silence during the call. Therefore to temporarily mute or unmute microphone, we recommend you use RTCRoom.publishStream/RTCRoom.unpublishStream.
  • You can call this API no matter you need to publish audio or not, but you can only publish audio after calling it.

Implementation

Future<int?> startAudioCapture();