Media@knitui/media
LiveAudioMeter
A live microphone level meter built on useAudioStream. On web it captures the mic via getUserMedia + a Web Audio AnalyserNode; on React Native it wraps expo-audio's useAudioStream (PCM buffers decoded via decodePcm). Both share one platform-free contract. Requires microphone permission, granted on Start.
WebiOSAndroid6 own props3 examples
import { LiveAudioMeter } from "@knitui/media";Playground
Loading playground…
<LiveAudioMeter
metric="rms"
/>Examples
Basic
Loading example…
Peak Meter
Loading example…
Stereo
Loading example…
Props
| Prop | Type | Default | Description |
|---|---|---|---|
channels | number | undefined | — | |
encoding | AudioStreamEncoding | undefinedfloat32 · int16 | — | |
label | string | undefined | — | Accessible label for the meter region. |
metric | "rms" | "peak" | undefinedrms · peak | rms | Whether to display the rms (loudness) or peak amplitude. Default `'rms'`. |
sampleRate | number | undefined | — | Stream options forwarded to {@link useAudioStream}. |
testID | string | undefined | — |