How to use Voice Activation
The voice_activation
parameter controls dynamic participant visibility in the video layout. By default, this parameter is set to false
.
When the number of participants exceeds available layout spots, voice activation automatically manages which participants are displayed. Active participants (those speaking and with cameras enabled) will dynamically replace inactive participants in the video stream.
Figure 1. This screenshot shows the
four
layout with five participants. With voice activation disabled, the fifth participant remains off-screen regardless of speaking status.
Figure 2. With voice activation enabled, the fifth participant appears in the layout when they begin speaking.
You can implement this feature using the code snippets below.
- bash
- shell
- node
export ACCESS_KEY=123...
curl -X POST \
-d "layout=auto" \
-d "voice_activation=true" \
"https://api.eyeson.team/rooms/$ACCESS_KEY/layout"
SET ACCESS_KEY=123...
curl -X POST ^
-d "layout=auto" ^
-d "voice_activation=true" "https://api.eyeson.team/rooms/%ACCESS_KEY%/layout"
import fetch, { FormData } from 'node-fetch';
const ACCESS_KEY = '123...';
const url = 'https://api.eyeson.team/rooms/' + ACCESS_KEY + '/layout';
const formData = new FormData();
formData.set('layout', 'auto');
formData.set('voice_activation', 'true');
await fetch(url, { method: 'POST', body: formData });
This feature is only available if the layout is set to auto
.