Skip to main content
When a desktop assistant already owns the microphone and speaker, the web UI needs a small stream of status messages. OpenToys uses this design for its Mac app and talking toys. The browser can show exactly when the device is listening or replying without opening another microphone. OpenToys voice component

Run a test signal server

Install ws with npm install ws, save this as voice-server.mjs, and run node voice-server.mjs. It serves simulated turn data on loopback. Run your React app on http://localhost:5173 or adjust the allowed origin to match your local UI.

Display the latest complete signal

Install orb-ui in the React app. Each message contains a full snapshot, so a new turn replaces both readings. The effect owns one socket. Clicking Reconnect or unmounting removes its handlers before closing it, which prevents an old close event from overwriting a new session.

Replace the simulator with your assistant

Send listening and a normalized microphone level during capture. Send thinking after the user finishes. Switch to speaking when playback starts and meter the output through its final buffer. On interruption, clear the output meter before the next listening update. Emit the current snapshot as soon as a client reconnects. Stop the server mid-reply. The status should change to disconnected and the old speaking level should disappear. Restart the server and click Reconnect. For a remote assistant, use an authenticated secure WebSocket and restrict its allowed origins to your application. Custom integration contract
Last modified on November 26, 2026