GitHub

Source

BarVisualizer

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Visualizes audio signals from a TrackReference as bars. If the state prop is set, it automatically transitions between VoiceAssistant states.

Import

import { BarVisualizer } from "@livekit/components-react";

Remarks

For VoiceAssistant state transitions this component requires a voice assistant agent running with livekit-agents >= 0.9.0

Usage

function SimpleVoiceAssistant() {
const { state, audioTrack } = useVoiceAssistant();
return <BarVisualizer state={state} trackRef={audioTrack} />;
}