ActiveSpeakerObserver does not emit events

Hi everyone!

Does anyone know what could be the reason for not getting any events from ActiveSpeakerObserver instance?

I’ve initialized the observer on the top level like this:

const observer = await router.createActiveSpeakerObserver({interval: 500})

observer.on('dominantspeaker', (payload) => {
	console.log('event payload', payload)
})

For debugging I’ve added logs after lines 19 and 20 in mediasoup/ActiveSpeakerObserver.js at v3 · versatica/mediasoup · GitHub and I see that handleWorkerNotifications is called, but this.channel.on never fires its callback when people start and stop speaking.

Both audio and video is sent and received correctly between the participating peers, so audio data definitely flows the way it should.

You are not adding audio producers to the observer so obviously it won’t work. Please check the API.

1 Like

Thank you very much! I must have missed that in the docs at the first glance. I see it now, but what do you think about adding a corresponding note straight to mediasoup :: API?

It clearly says that the class @inherits RtpObserver