Android SDK v1.9.5+

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 onActiveTalkersUpdated callback is limited to the max_active_talkers setting of the Room.

ClassEnxRoom

Observer: public void setEnxTalkerNotificationObserver(Talker-Observer-Instance)

Method: public void subscribeForTalkerNotification(Boolean isEnabled, EnxTalkerNotificationObserver e)

Parameters:

  • isEnabled: Boolean. Set to true to subscribe to Talker Notification and false to unsubscribe.
  • EnxTalkerNotificationObserver

Callbacks:

  • onAckSubscribeTalkerNotification – Acknowledgment to the subscriber when Talker Notification subscribed successfully.
  • onAckUnsubscribeTalkerNotification – Acknowledgment to the subscriber when Talker Notification unsubscribed successfully.
  • onTalkerNotification – Notification to the subscriber received with JSON Object carrying the details of users from whom speech or sound is detected.
room.subscribeForTalkerNotification(true, this); // To subscribe
room.subscribeForTalkerNotification(false, this); // To unsubscribe

// Acknowledgement on Talker Subscription
public void onAckSubscribeTalkerNotification(JSONObject jsonObject) {
	// JSON Object example
	/* 
	{	"result": { 
			"result": 0, 
			"msg": "Success"
		},
		"id": "talker-notification”
	}
	*/
}

// Acknowledgement on Talker Unsubscription
public void onAckUnsubscribeTalkerNotification(JSONObject jsonObject) {
	// JSON Object example
	/* 
	{	"result": { 
			"result": 0, 
			"msg": "Success"
		},
		"id": "talker-notification”
	}
	*/
}

// Receive Talker Notification on Subscription
public void onTalkerNotification(JSONObject jsonObject) {
	// JSON Object example given later in the document
}

onTalkerNotification JSON Payload:

  • data: An array of objects. Each object consists of an array of users who are talking and an array of users who are merely a source of noise.
    • speech: It contains users, an array of client information who are talking with their clientId and speechType (Intensity) as low, media high
    • noise: An array of clientIds producing noise.
{
  "type": "talker-notification",
  "data": [
    {
      "speech": true,
      "users": [
        {
          "speechType": "high"
          "clientId": "xxxxx"
        },
        {
          "speechType": "medium"
	  "clientId": "yyyyy"
        },
        {
          "speechType": "low"
	  "clientId": "zzz"
        }
      ]
    },
    {
      "noise": true,
      "users": [
        {
          "clientId": "sssss"
        },
        {
          "clientId": "uuuuu"
        }
      ]
    }
  ]
}

Error Codes / Exceptions:

CodeDescription
5128Repeated subscription request call while a previous request is in process.
5129Repeated unsubscription request call while a previous request is in process.
5130Talker Notification already subscribed.
5131Illegible attempt to unsubscribe Talker Notification without subscribing first.