react-native-agora icon indicating copy to clipboard operation
react-native-agora copied to clipboard

How to get remote microphone mute/unmute state

Open thecodecafe opened this issue 4 years ago • 3 comments

Hi, please I've been on this for about a week now, how can one get the state of a remote user's microphone?

I tried using RemoteAudioStateChanged event but it's not working as I expect. Based on the documentation this event has two things (state and reason) I should be able to use in the callback.

But every time I unmute state moved to 1 (Starting) and then to 2 (decoding) if I unmute it again moves from 1 (Starting) and then to 2 (decoding). Reason moves to 0 (Internal), then to 3(LocalMuted), and then to 2(NetworkRecovery) both when I mute and when I unmute.

I use the following code to toggle the mic for the users on their end.

function toggleMicrophone (state: boolean) {
  engine.enableLocalAudio(state)
    .then(() => {
      // Do something
    })
    .catch((e) => console.log(e))
}

I don't quite understand how to use this to get the remote user's microphone mute/unmute state, please can anyone help?

Thanks!

thecodecafe avatar Jun 10 '21 20:06 thecodecafe

could you pls provide the SDK log file?

LichKing-2234 avatar Jun 11 '21 00:06 LichKing-2234

Hi @LichKing-2234 how can I get the SDK log file?

thecodecafe avatar Jun 11 '21 08:06 thecodecafe

You can have a look at my screenshots here: https://github.com/AgoraIO-Community/react-native-agora/issues/372 You can print all your own logs out, it would be easier to see the problem. BTW: here's the SDK log file location:

 * Android: 
{{/storage/emulated/0/Android/data/<package name>/files/agorasdk.log}}
 * iOS: 
{{}}
{{App Sandbox/Library/Caches/agorasdk.log  }}

louxinbo avatar Jun 14 '21 23:06 louxinbo