@@ -11,6 +11,10 @@ import '../../../context/track_reference_context.dart';
1111
1212enum VisualizerState { thinking, listening, active }
1313
14+ /// Configuration options for [AudioVisualizerWidget] .
15+ ///
16+ /// These options control the number of bars, sizing, animation cadence, and
17+ /// styling used to render a simple audio spectrum / agent-state indicator.
1418class AudioVisualizerWidgetOptions {
1519 final int barCount;
1620 final bool centeredBands;
@@ -77,6 +81,24 @@ class AudioVisualizerWidget extends StatelessWidget {
7781 final AudioVisualizerWidgetOptions options;
7882 final Color backgroundColor;
7983
84+ /// Renders an animated bar visualizer for the current audio track.
85+ ///
86+ /// The widget consumes a [TrackReferenceContext] from the widget tree to
87+ /// discover the `sdk.AudioTrack` and associated `sdk.Participant` . When the
88+ /// participant is an agent, the visualizer also reacts to agent state changes:
89+ ///
90+ /// - `thinking` : highlights bars in sequence.
91+ /// - `initializing` / `listening` : renders a subtle "listening" pulse.
92+ /// - otherwise: uses live audio samples when available.
93+ ///
94+ /// Example:
95+ /// ```dart
96+ /// ParticipantTrack(
97+ /// participant: participant,
98+ /// track: publication,
99+ /// builder: (context) => const AudioVisualizerWidget(),
100+ /// );
101+ /// ```
80102 const AudioVisualizerWidget ({
81103 Key ? key,
82104 this .backgroundColor = Colors .transparent,
0 commit comments