feat(shadcn): add volumeBands override prop to agents-ui visualizers#1399
Open
thomasyuill-livekit wants to merge 5 commits into
Open
feat(shadcn): add volumeBands override prop to agents-ui visualizers#1399thomasyuill-livekit wants to merge 5 commits into
thomasyuill-livekit wants to merge 5 commits into
Conversation
Lets callers drive Bar/Radial/Grid/Wave/Aura visualizers with precomputed volume data instead of live useMultibandTrackVolume/useTrackVolume output, while preserving existing state/track visibility gates. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Contributor
size-limit report 📦
|
Bar/Radial/Grid now trim excess values or pad by duplicating the last value when a supplied volumeBands array doesn't match the expected count. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Replace volumeBands (number[]) with a scalar volume prop on Wave/Aura, since they only ever needed one value. Drops the now-unused resolveVolumeFromBands averaging helper. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Bar/Grid never gated on audioTrack, only Radial did, which silently zeroed out an explicitly-provided volumeBands override whenever no live track was connected. Also adds Storybook demos (with a shared simulated speech-waveform generator) showing the volumeBands/volume override for all 5 agents-ui visualizers. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1egoman
approved these changes
Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Related to https://github.com/livekit/web/pull/4377
The demo's on livekit.com/products/agents-ui require simulated audio.
We don't have a mechanism for providing an audioTrack, so the components needed to be forked.
This complicates updates and maintenance.
Overview
Adds override props to the
agents-uiaudio visualizer components,letting callers provide precomputed volume data overriding the live audio hooks.
Multiband visualizers (
Bar/Radial/Grid) accept avolumeBandsarraySingle-value visualizers (
Wave/Aura) accept a scalarvolume.Summary of changes
AgentAudioVisualizerBarvolumeBands?: number[]useMultibandTrackVolume; still gated onstate === 'speaking'. Array is trimmed or padded (duplicating the last value) to matchbarCount.AgentAudioVisualizerRadialvolumeBands?: number[]audioTrackbeing present. Normalized tobarCount.AgentAudioVisualizerGridvolumeBands?: number[]state === 'speaking'. Normalized tocolumnCount.AgentAudioVisualizerWavevolume?: numberuseTrackVolumevalue directly.AgentAudioVisualizerAuravolume?: numbernormalizeVolumeBandsinpackages/shadcn/lib/utils.tsTesting