Plain microphone
No dependenciesStart hereThe simplest wiring: drive state yourself and feed levelRef from the bundled use-audio-level hook, which reads the microphone through a shared AnalyserNode. When levelRef is negative the orb falls back to its procedural animation, so the orb keeps moving even before the user grants mic access.
Copy the adapter from src/registry/lib/use-audio-level.ts into your project first.
'use client';import { useState } from 'react';import type { OrbState } from '@/registry/lib/orb-state';import { useAudioLevel } from '@/registry/lib/use-audio-level';import { PulseOrb } from '@/registry/orbe/pulse-orb/pulse-orb';export const MicrophoneOrb = () => {const [state, setState] = useState<OrbState>('idle');const { levelRef, error } = useAudioLevel(state === 'listening');return (<div className="flex flex-col items-center gap-4"><PulseOrb state={error ? 'error' : state} levelRef={levelRef} /><buttontype="button"onClick={() => setState(state === 'listening' ? 'idle' : 'listening')}>{state === 'listening' ? 'Stop' : 'Listen'}</button></div>);};