- the current voice agent state
- the current input or output volume
- when the session starts and stops
OrbSignal is the boundary between your voice runtime and the visual layer. Keep provider-specific
events on one side of that boundary and emit the same small contract to React:
Common sources
Controlled mode works well with:- WebRTC sessions
- WebSocket voice streams
- telephony systems
- internal speech pipelines
- provider SDK wrappers
- experimental OpenAI Live, OpenAI Realtime, or Gemini Live API prototypes
Normalize state once
Custom runtimes often expose more states than a voice visualization needs. Map them in one function so the rest of the UI does not depend on transport terminology.Normalize both volume directions
inputVolume and outputVolume should be normalized from 0 to 1.
inputVolume for microphone activity and outputVolume for assistant playback. Themes can
then respond to the side of the conversation that owns the turn:
Keep session controls explicit
When your application already owns the call lifecycle, render the orb as a passive visualization and keep labeled controls beside it:Build an adapter later
If the same runtime integration is used in several components or applications, wrap it in an adapter. The adapter should subscribe to runtime events, emit a complete signal snapshot, own start and stop behavior when appropriate, and release every listener and browser resource during cleanup. See the signal-based voice agent UI guide for the complete contract, state and volume normalization guidance, and a production-shaped adapter with cleanup.Errors and cleanup
Translate runtime failures intostate: 'error' with the original Error when possible, but keep
user-facing recovery copy in the application. Microphone denial, transport timeout, and remote
session rejection usually need different next steps.
On stop or unmount, release any microphone tracks, analyser loops, audio contexts, media elements,
WebRTC peer connections, WebSocket listeners, and provider subscriptions your integration created.
The orb can only reflect lifecycle accuracy if the underlying runtime actually returns to idle.
Custom integration checklist
- Provider events map to the six supported states in one place.
- Input and output levels are separately normalized between
0and1. - Normal speech occupies the middle of the range instead of clustering near zero or one.
- Every subscription has a matching cleanup function.
- Start and stop can be called again after an error.
- Microphone permission and connection failures have visible recovery actions.
- A text label communicates state without relying on motion or color.