audioVolumeIndication property

AudioVolumeCallback? audioVolumeIndication
getter/setter pair

Reports the volume information of users. By default, this callback is disabled. You can enable it by calling enableAudioVolumeIndication . Once this callback is enabled and users send streams in the channel, the SDK triggers the enableAudioVolumeIndication callback at the time interval set in audioVolumeIndication. The SDK triggers two independent audioVolumeIndication callbacks simultaneously, which separately report the volume information of the local user who sends a stream and the remote users (up to three) whose instantaneous volumes are the highest. After you enable this callback, calling muteLocalAudioStream affects the SDK's behavior as follows: If the local user stops publishing the audio stream, the SDK stops triggering the local user's callback. 20 seconds after a remote user whose volume is one of the three highest stops publishing the audio stream, the callback excludes this user's information; 20 seconds after all remote users stop publishing audio streams, the SDK stops triggering the callback for remote users.

Param speakers The volume information of the users, see AudioVolumeInfo . An empty speakers array in the callback indicates that no remote user is in the channel or sending a stream at the moment.

Param totalVolume The volume of the speaker. The value range is 0,255. In the callback for the local user, totalVolume is the volume of the local user who sends a stream. In the callback for remote users, totalVolume is the sum of the volume of all remote users (up to three) whose instantaneous volumes are the highest. If the user calls startAudioMixing , then totalVolume is the volume after audio mixing.

Implementation

AudioVolumeCallback? audioVolumeIndication;