Voice activity detection. Use this hook to check if voice is detected in audio track for given peer(s).
Example usage:
function WhoIsTalkingComponent({ peerIds }: { peerIds: PeerId[] }) { const peersInfo = useVAD({peerIds}); const activePeers = (Object.keys(peersInfo) as PeerId[]).filter((peerId) => peersInfo[peerId]); return `Now talking: ${activePeers.join(", ")}`;} Copy
function WhoIsTalkingComponent({ peerIds }: { peerIds: PeerId[] }) { const peersInfo = useVAD({peerIds}); const activePeers = (Object.keys(peersInfo) as PeerId[]).filter((peerId) => peersInfo[peerId]); return `Now talking: ${activePeers.join(", ")}`;}
List of ids of peers to subscribe to for voice activity detection notifications.
Each key is a peerId and the boolean value indicates if voice activity is currently detected for that peer.
Voice activity detection. Use this hook to check if voice is detected in audio track for given peer(s).
Example usage: