About sampling the local microphone input

Hello,

What wanting to do)
When a user is speaking but his or her microphone is muted, I want to display a message saying “Are you talking? Press the microphone to turn it on.”

For Twilio)
When using Twilio, I could sample the microphone input like this:

    private val audioSink = AudioSink { audioSample, _, _, _ ->
        val microphoneLevel = audioSample.get().toInt().absoluteValue
        if  (microphoneLevel > 50) showMessage("Are you talking? Press the microphone to turn it on.")
    }
    
    localAudioTrack?.addSink(audioSink)

What I tried)
I’ve checked the following events, but after local user being muted there is no event raised.

override fun onUserAudioStatusChanged(audioHelper: ZoomVideoSDKAudioHelper?, userList: MutableList<ZoomVideoSDKUser>) {
    val localUser = userList.firstOrNull { it.userID == zoomSession?.mySelf?.userID } ?: return
    Log.d(TAG,  "onUserAudioStatusChanged(isTalking: ${localUser.audioStatus.isTalking})")
}

override fun onUserActiveAudioChanged(audioHelper: ZoomVideoSDKAudioHelper?, userList: MutableList<ZoomVideoSDKUser>) {
    val localUser = userList.firstOrNull { it.userID == zoomSession?.mySelf?.userID } ?: return
    Log.d(TAG,  "onUserActiveAudioChanged(isTalking: ${localUser.audioStatus.isTalking})")
}

Inquiry)
Would there be a way to do the same as Twilio?

Environment)
Platform: Android
Zoom SDK: us.zoom.videosdk:zoomvideosdk-core=1.12.5
Test Device: Pixel 3a (Android ver. 12.0)

Thanks

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.