Skip to main content
A voice orb needs two inputs. The conversation state tells you who has the turn. The audio level tells you how much to move. This example builds a faceted Three.js sphere that turns teal while listening, violet while speaking, and gray when idle. The louder the active speaker gets, the larger the sphere grows. React Three Fiber renders the scene inside a React component. Orb UI supplies the current state and a normalized activity value to your custom renderer. You can test the whole animation with a slider before connecting audio.

Install the scene dependencies

In a React 19 web app with TypeScript, install the renderer and its type declarations.
For React 18, use @react-three/fiber@8. The renderer’s major version follows the React version in your app. React Three Fiber installation guide

Build the orb and try both sides of a conversation

Save this as VoiceOrbDemo.tsx and render <VoiceOrbDemo /> on a page. Select Listening and move the microphone slider. Then select Speaking. Only the assistant slider should affect the orb during that turn.
The mesh requests another frame while its size approaches the target. Once it settles, the canvas sleeps until something changes. This also lets a silent or idle orb hold still. React Three Fiber render loop

Connect a voice session

If your app already owns the session, replace the slider values with its current signal. While the user is listening to the assistant, the state is speaking and outputVolume is the level of the audio being played. While the microphone is listening to the user, set inputVolume from the microphone meter. Set the state to thinking while the agent prepares a reply. The renderer receives zero activity in this state. If you use a provider adapter, give the same renderer to the adapter-backed orb. Keep your existing Start and Stop controls and visible state label alongside the canvas.
If the orb changes color but stays the same size, watch the active speaker’s level during a turn. If it stays at zero, check the meter feeding that direction. If it stays at one, normalize the input before passing it to the renderer. Volume calibration To compare this mesh with the built-in cloud and radial artwork, try the interactive React voice orb example. To connect a custom WebSocket client, follow the custom voice integration guide.
Last modified on November 26, 2026