Skip to main content
A microphone gives you a stream of samples. Orb UI needs one number between zero and one. This example measures the energy in a short window of audio and uses that value to animate a listening orb. The audio stays in the browser.

Try it in a React app

Install orb-ui and save this component as MicrophoneOrb.tsx. Open the page on HTTPS or localhost. The Start microphone button gives the browser a user gesture for starting audio and asking permission.

Tune the motion on your microphone

Record a quiet room level and an ordinary speaking level by inspecting rms while testing. The example treats 0.01 as silence and 0.15 as full scale. Replace those two anchors with measurements from your device. The analyser has no connection to the speakers, which prevents local microphone feedback. Web Audio waveform samples Try speaking softly, clapping once, and pressing Stop while the permission prompt is open. When capture ends, the orb should return to idle and the microphone indicator should disappear. For a two-person conversation, measure assistant playback separately and send that level as outputVolume during the speaking state. Directional volume calibration · 3D voice orb example
Last modified on November 26, 2026