Components / AI interfaces
Voice orb
An animated orb for voice modes that shows listening, thinking and speaking.
Functions: cui_voice_orb

Usage
if (cui_voice_orb(ui, "voice", listening ? CUI_VOICE_LISTENING : CUI_VOICE_IDLE, mic_level)) toggle_listening();
It breathes when idle, ripples with the level while listening, sends a ring of dots around while thinking and swells with the voice while speaking. It moves between states smoothly.
Returns true on the frame the orb is clicked. The orb records and plays nothing: you pass the state and the loudness on every frame, and it only draws them. The state is one of CUI_VOICE_IDLE, CUI_VOICE_LISTENING, CUI_VOICE_THINKING and CUI_VOICE_SPEAKING, and is yours to change, for example on the click. The last argument is the loudness of the microphone or of the voice, from 0 to 1; values outside are clamped, and the orb smooths the changes, so raw peaks can be passed as they come. The library keeps the animation under id. Options: size, the diameter in points (160), and color.
Keyboard
- Tab focuses the orb, and Enter or Space clicks it.
Options of cui_voice_orb
| Option | Type | Default | Description |
|---|---|---|---|
.size | float | Size in points; 0 uses the component's own. | |
.color | cui_color | A theme color such as CUI_COLOR_ACCENT, or CUI_RGB(0x7747ff); unset uses the theme's. |
Related
- Suggestions, response actions and the context meter: Prompt suggestions to start from, the actions under a response, and a ring that shows how full the context is.
- Composer and model picker: The message box of a chat, with attachments, send and stop, and a menu for choosing the model.
- Sources and citations: Citations inside an answer and the list of sources they point to.
- Agent plan and status: The steps an agent is working through, and a pill that says what it is doing now.