Availability: iOS 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
delegate is limited to the max_active_talkers
setting of the Room.
Class: EnxRoom
Method: -(void)subscribeForTalkerNotification:(BOOL)enabled
– To subscribe or unsubscribe notification
Parameters:
enabled
: BOOL. Set to true to subscribe to Talker Notification and false to unsubscribe.
Delegate Methods:
- room:didAckSubscribeTalkerNotification:
– Acknowledgment to the subscriber when Talker Notification subscribed successfully.- room:didAckUnsubscribeTalkerNotification:
– Acknowledgment to the subscriber when Talker Notification unsubscribed successfully.- room:didTalkerNotification:
– Notification to the subscriber received with JSON Object carrying the details of users from whom speech or sound is detected.
[room subscribeForTalkerNotification:true]; // To subscribe [room subscribeForTalkerNotification:false]; // To unsubscribe // Acknowledgement on Talker Subscription -(void)room:(EnxRoom *_Nullable)room didAckSubscribeTalkerNotification:(NSArray *_Nullable)data; /* data example: ({ "result": { "result": 0, "msg": "Success" }, "id": "talker-notification” }) */ // Acknowledgement on Talker Unsubscription -(void)room:(EnxRoom *_Nullable)room didAckUnsubscribeTalkerNotification:(NSArray *_Nullable)data; /* data example: ({ "result": { "result": 0, "msg": "Success" }, "id": "talker-notification” }) */ // Receive Talker Notification on Subscription -(void)room:(EnxRoom *_Nullable)room didTalkerNotification:(NSArray *_Nullable)data;
Response JSON Payload: - room:didTalkerNotification:
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. |