audioVolumeIndication property
Reports which users are speaking and the speakers' volume, and whether the local user is speaking.
This callback reports the IDs and volumes of the loudest speakers (at most 3) at the moment in the channel, and whether the local user is speaking. By default, this callback is disabled. You can enable it by calling the RtcEngine.enableAudioVolumeIndication method. Once enabled, this callback is triggered at the set interval, regardless of whether a user speaks or not. The SDK triggers two independent audioVolumeIndication callbacks at one time, which separately report the volume information of the local user and all the remote speakers. For more information, see the detailed parameter descriptions.
Note
- To enable the voice activity detection of the local user, ensure that you set
report_vad
(true) in the RtcEngine.enableAudioVolumeIndication method. - Calling the RtcEngine.muteLocalAudioStream method affects the SDK's behavior. -- If the local user calls the RtcEngine.muteLocalAudioStream method, the SDK stops triggering the local user's callback. -- 20 seconds after a remote speaker calls the RtcEngine.muteLocalAudioStream method, the remote speakers' callback does not include information of this remote user; 20 seconds after all remote users call the the RtcEngine.muteLocalAudioStream method, the SDK stops triggering the remote speakers' callback.
The AudioVolumeCallback
typedef includes the following parameters:
- List<AudioVolumeInfo>
speakers
: An array containing the user ID and volume information for each speaker. - int
totalVolume
: Total volume after audio mixing. The value ranges between 0 (lowest volume) and 255 (highest volume).
Implementation
AudioVolumeCallback? audioVolumeIndication;