I want to use onUserActiveAudioChange to track the active speaking time of each participant. My question is how to implement such a function and where should I call it

Which version?

Additional context
I found the function its in the IMeetingAudioCtrlEvent.
I want to know how can I use it.
Any help would be appreciated

Hey @ahmad.am,

Thanks for using the dev forum!

Great question! onUserActiveAudioChange is a virtual function that is a callback. Normally you should not call these functions as they are intended to be called by someone else. In this case, the SDK will call these functions for you when they need to be called.

The class that you would like to use this callback in needs to inherit from IMeetingAudioCtrlEvent. Then that class must implement the virtual functions defined in IMeetingAudioCtrlEvent, like onUserActiveAudioChange. This makes your class able to run whatever code you want when onUserActiveAudioChange is called. The last thing you have to do is tell the IMeetingAudioController that your class is the event listener using the SetEvent method.

The demo application implements this and should be a good resource for reference.