# About sampling the local microphone input

**URL:** <https://devforum.zoom.us/t/about-sampling-the-local-microphone-input/121855>\
**Category:** Android\
**Tags:** phone\
**Created:** [December 3, 2024, 9:22am UTC](https://devforum.zoom.us/t/about-sampling-the-local-microphone-input/121855 "2024-12-03T09:22:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Watasan](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/watasan/32/64875_2.png) [@Watasan](https://devforum.zoom.us/u/Watasan)\
**Post date:** [December 3, 2024, 9:22am UTC](https://devforum.zoom.us/t/about-sampling-the-local-microphone-input/121855/1 "2024-12-03T09:22:22Z")

</div>

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:

```kotlin
    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.

```kotlin
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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [January 2, 2025, 7:23pm UTC](https://devforum.zoom.us/t/about-sampling-the-local-microphone-input/121855/2 "2025-01-02T19:23:09Z")

</div>

Closed on January 2, 2025, 7:23pm UTC

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