Create a dynamic voice energy meter
Learn how to create a visual meter showing voice activity.
Read time 2 minutesLast updated 2 days ago
Some application features might require a real-time visual representation of audio energy levels, sometimes called a Voice Unit (VU) meter. For example, this might be needed for a microphone check. By default, the Vivox SDK is set up to support a simple speaking or not-speaking indicator for channel participants that is based on whether voice activity is detected; for that use case, you can iterate over IChannelSession::Participants() and check for SpeechDetected() or handle IChannelSession.EventAfterParticipantUpdated events to be notified when a participant’s speaking state changes. Real-time capability requires one extra step.
Setting a "participant updated" event frequency for a speaking activity
To create a dynamic voice activity indicator, call ILoginSession::SetParticipantSpeakingUpdateRate() with aParticipantSpeakingUpdateRateUpdate1HzUpdate5HzUpdate10HzSetParticipantSpeakingUpdateRate()EventAfterParticipantUpdatedILoginSessionDisabling a "participant updated" event frequency for a speaking activity
Calling ILoginSession::SetParticipantSpeakingUpdateRate() with a value ofParticipantSpeakingUpdateRate::NeverStateChangeSpeechDetected()AudioEnergy()