Audio Orb
A glassy orb for voice agents that breathes at rest, follows the person's voice, swirls while thinking, and pulses with the reply.
Overview
Audio Orb gives a voice conversation something to look at while nobody is reading. It is a shaded sphere drawn with WebGL, with a slow flow inside it and a soft halo around it. Each state moves it differently:
The orb shows state; it does not decide it. state comes from your voice pipeline, and the levels come from audio you already have. It never asks for the microphone itself.
Audio Orb takes the same state, inputLevel, and outputLevel as the Voice Orb component in Honest AI, so you can swap one for the other. Voice Orb is a monochrome canvas mark that fits small spaces; Audio Orb is the richer, colored version for a voice agent's main screen.
Installation
Usage
import { AudioOrb } from "honestui/shaders"
<div className="size-64">
<AudioOrb state={state} inputLevel={micLevel} outputLevel={() => player.level()} />
</div>A level is a number from 0 to 1, or a function the orb calls once per frame. A function avoids a React render per audio frame, so prefer it for live audio.
Analysing a stream
Pass a MediaStream and the orb opens its own analyser, reads the loudness and three frequency bands, and closes the analyser when the stream changes or the orb unmounts. Low frequencies swell the orb in broad lobes, the middle adds folds, and highs add a fine ripple. Pass an AnalyserNode you own instead, for example one connected to the agent's audio output, and the orb reads it without closing it.
The stream or analyser drives whichever level you leave out. Set inputLevel or outputLevel yourself to override it.
Examples
Microphone
The microphone opens only when the button is pressed, and the orb follows it while listening.
Sizing and color
Leave size unset and the orb fills its container, centered, with room around the body for the halo. Set size for a fixed square in pixels. The background is transparent, so the orb sits on your own surface in light and dark themes.
colors takes three hex colors: the highlight, the body, and the deep shade. Keep enough difference between the body and the deep shade for the sphere to read as round.
Accessibility
The canvas is hidden from assistive technology. By default the orb also renders its state, such as "Listening", in a polite status region, so a screen reader hears the change. Set announce={false} when your own text already says it, and change the words with labels.
When the user prefers reduced motion, the orb renders one still frame and adds a small mark for each state: a dot at rest, a microphone while listening, three dots while thinking, and bars while speaking, so the state is not shown by motion alone. The orb also stops drawing while it is offscreen or the tab is hidden. Without WebGL2 the container shows only its background, and the status text still updates.