[React Native Daily] Highlight speaking user

Options
MSek
MSek Member

Hey, it is possible to track when users speak, f.e. by their audio level?

I want to highlight users only when they are actually speaking, so active-speaker-change event isn't good enough as it won't trigger the user audio level drops.

I've tried to get the PeerConnection instance to poll the .getStats method, but everything seems to be hidden inside call-machine-object-bundle.js :)


Thanks in advance!

Best Answer

  • filipi
    filipi Dailynista
    Answer ✓
    Options

    Hi @MSek ,

    Early next year we are going to release a new version of our SDK ( daily-js and react-native-daily-js ) which is going to allow using the event active-speaker-change to be aware when we have silence.

    So, this is what we are already sending, when we have an active speaker:

    {
     "action": "active-speaker-change",
     "activeSpeaker": {
      "peerId": "049ebba2-523b-4e6c-9a9f-1f8bb956670d"
     }
    }
    

    And this is what we are going to start to send, when we have silence:

    {
     "action": "active-speaker-change",
     "activeSpeaker": {
      "peerId": null
     }
    }
    


    We also have in our backlog to create a new API to allow audio level observation, but this one is still in spec stage, and we don’t have a schedule yet of when we intend to release It.