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.
Class: EnxRoom
Observer: public void setEnxTalkerNotificationObserver(Talker-Observer-Instance)
Method: public void subscribeForTalkerNotification(Boolean isEnabled, EnxTalkerNotificationObserver e)
Parameters:
- isE
nabled
: 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 containsusers
, an array of client information who are talking with theirclientId
andspeechType
(Intensity) aslow
,media high
noise
: An array ofclientIds
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:
Code | Description |
---|---|
5128 | Repeated subscription request call while a previous request is in process. |
5129 | Repeated unsubscription request call while a previous request is in process. |
5130 | Talker Notification already subscribed. |
5131 | Illegible attempt to unsubscribe Talker Notification without subscribing first. |