Run a test signal server
Installws 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
Installorb-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
Sendlistening 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