How to Use Voice Activation
The voice_activation
parameter controls participant visibility in the video layout. When the number of participants exceeds the available layout spots, active participants (those speaking and with cameras enabled) dynamically replace inactive ones in the video stream. By default, this parameter is set to false
.
This feature is only available if the layout is set to auto
.
Code Examples
- curl
- node sdk
- go sdk
- php sdk
export ACCESS_KEY=...
curl -X POST \
-d "layout=auto" \
-d "voice_activation=true" \
"https://api.eyeson.team/rooms/$ACCESS_KEY/layout"
const accessKey = '...';
const eyeson = new Eyeson();
const user = await eyeson.getUser(accessKey);
await user.setLayout({
layout: 'auto',
voice_activation: true,
});
accessKey := "..."
userService, _ := eyeson.NewUserServiceFromAccessKey(accessKey)
userService.SetLayout(eyeson.Auto, &eyeson.SetLayoutOptions{
ShowNames: true,
VoiceActivation: true,
})
$accessKey = '...';
$eyeson = new Eyeson();
$layout = $eyeson->layout($accessKey);
$layout->apply([
'layout' => 'auto',
'voice_activation' => true
]);
Visual Examples
To demonstrate the behavior of the voice_activation
parameter, the layout
parameter is set to auto
and five participants are added to the video meeting. The image below displays the Prebuilt-UI with the applied settings. When voice_activation
is set to false
, the fifth participant remains off-screen regardless of speaking status.
When voice_activation
is set to true
, the fifth participant appears in the layout as soon as microphone activity is detected.