AI Voice
エーアイボイス
A push-to-talk control: a mic button, an elapsed timer and a bar meter. With live set it asks for the microphone through getUserMedia↗↗ and drives the bars from an AnalyserNode↗↗, one bar per slice of the frequency spectrum. If permission is refused, no input device exists, or the browser has no AudioContext, it does not throw — it falls back to a synthetic trace so the recorder keeps working. The tracks and the audio context are torn down when recording stops, which is what actually releases the microphone indicator. Off by default, since a component should not ask for the mic just to be rendered. Adapted from Kokonut UI↗↗ under the MIT licence.
Click to speak
Installation
Copy and paste the following code into a new component file:1
How to use it2
Props
AiVoice
| Name | Default | Description |
|---|---|---|
| bars | 48 | number Number of bars in the meter |
| live | false | boolean Drive the meter from the real microphone instead of a synthetic trace |
| onStop | — | (seconds: number) => void Called when recording stops, with the length of the take |
| dark | false | boolean Render the dark palette |