Search code examples
ioswebrtclibjinglepeer-connection

How to implement "Who is talking?" feature in webrtc ios application?


I am creating an ios application using webRTC for video conferencing. I want to detect who is talking in the peer connection.

To be more specific,I want to detect the audio activity of the remote peer I am connected to so that I can detect the person who is currently speaking.


Solution

  • This can be implemented by measuring the value of "audioOutputLevel" in peer-connection stats reports. The Function that will you should study is

    - (void)peerConnection:(RTCPeerConnection*)peerConnection didGetStats:(NSArray*)stats