logo
On this page

When using the "muteMicrophone" and "enableAudioCaptureDevice" interfaces and setting the parameter to false, what is the difference between them?

2023-12-11
Products / Plugins:Video Call / Audio Call / Live streaming
Platform / Framework:All

Interface Differences

  • Using the muteMicrophone interface and setting the mute parameter to false means muting (turning off the microphone). At this time, the SDK will replace the audio data captured by the device with silent data for publishing, and the microphone device will still be occupied, and audio-related data will still be present in the publishing quality callback.

    Similar logic interfaces include "mutePublishStreamAudio".

  • Using the enableAudioCaptureDevice interface and setting the enable parameter to false means turning off the audio capture device. At this time, the SDK will no longer occupy the audio device. If publishing is in progress, by default it will use silent data as audio data for publishing.

How to Choose an Interface

  • If you must let the SDK release the microphone, such as implementing the function of releasing the microphone after the App goes to the background, you can call the enableAudioCaptureDevice interface to turn off the audio capture device, and use the isMicrophoneMuted interface to check if the microphone is muted.

  • Turning off or on the microphone through the enableAudioCaptureDevice interface at the hardware level is a time-consuming operation. If you operate frequently, it will incur certain performance overhead. It is generally recommended to use the muteMicrophone interface.

Previous

How to resolve conflicts when integrating Firebase Cloud Message simultaneously?

Next

On the Web platform, how to share system sound and microphone sound during screen sharing?

On this page

Back to top