Availability: Web SDK v1.9.4+

The subscribeForTalkerNotification() method allows you to receive notification for the talkers in the Room or the participants acting as a source of the noise. You can utilize this method for UI display or for debugging. Note that the list of talkers received could be longer than the Active Talkers list, because Active Talkers list received with active-talkers-updated event is limited to the max_active_talkers setting of the Room.

The subscribed Client Endpoint keeps receiving notifications with an event until unsubscribed.

Method: EnxRoom.subscribeForTalkerNotification(enabled, callback)

Parameters:

  • enabled – Boolean. Set to true to subscribe to Talker Notification, false to unsubscribe.
  • callback – Callback returns with response information on Talker Subscription/Unsubscription.

Event Listener:

talker-notification – Notification to the subscriber received with JSON Object carrying the details of users from whom speech or sound is detected.

room.subscribeForTalkerNotification(true, function(resp) {
	// response is a JSON, e.g.
	/*
	{ 	"result": 0,  
		"msg": "Success"  
	}
	*/  
}); 

room.addEventListener("talker-notification ", function(evt) {
	// evt is JSON with Talkers. Refer a sample given below 
	
});

talker-notification JSON Payload

  • message – Array of two types of objects. The object type is distinguished as speech and noise depending on the sound produced at the Talker’s Endpoint.
    • speech: An array of clientIds who are are talking.
    • noise: An array of clientIds producing noise.
{
  "type": "talker-notification",
  "message": [
    {
      "speech": true,
      "users": [
        {
          "clientId": "xxxxx"
        },
        {
          "clientId": "yyyyy"
        }
      ]
    },
    {
      "noise": true,
      "users": [
        {
          "clientId": "sssss"
        },
        {
          "clientId": "uuuuu"
        }
      ]
    }
  ]
}