Live Waveform
sv11-twango/live-waveformFreeComponent
A real-time audio waveform visualizer driven by a frequency array.
Live preview
live · rendered by the registry
Rendered by sv11-twango on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add http://sv11.ui.twango.dev/r/live-waveform.jsonSource
1<script lang="ts">2 import type { HTMLAttributes } from "svelte/elements";3 import { cn } from "$UTILS$.js";45 export type LiveWaveformProps = HTMLAttributes<HTMLDivElement> & {6 /**7 * When `true`, requests microphone access and drives the waveform from8 * live audio input. Toggling off stops the stream and closes the9 * audio context.10 * @default false11 */12 active?: boolean;13 /**14 * When `true` (and `active` is `false`), renders an animated placeholder15 * wave pattern. Use this to signal a processing or awaiting state.16 * @default false17 */18 processing?: boolean;19 /**20 * Specific `MediaDeviceInfo.deviceId` to capture from. Omit to use the21 * default microphone.22 */23 deviceId?: string;24 /**25 * Width of each bar in pixels.26 * @default 327 */28 barWidth?: number;29 /**30 * Minimum bar height in pixels. Bars are drawn at least this tall even31 * when their value is near zero.32 * @default 433 */34 barHeight?: number;35 /**36 * Gap between bars in pixels.37 * @default 138 */39 barGap?: number;40 /**41 * Corner radius applied to each bar.42 * @default 1.543 */44 barRadius?: number;45 /**46 * Custom bar color. Falls back to the canvas's computed `color` when47 * unset.48 */49 barColor?: string;50 /**51 * Fade the left and right edges of the waveform via a destination-out52 * gradient mask.53 * @default true54 */55 fadeEdges?: boolean;56 /**57 * Width of the edge fade region in pixels.58 * @default 2459 */60 fadeWidth?: number;61 /**62 * Height of the waveform container. Numbers are treated as pixels;63 * strings are passed through as a CSS length.64 * @default 6465 */66 height?: string | number;67 /**68 * Amplitude multiplier applied to normalized frequency data before69 * rendering. Higher values make quiet sounds visible.70 * @default 171 */72 sensitivity?: number;73 /**74 * Smoothing factor forwarded to the underlying `AnalyserNode` in75 * `[0, 1]`. Higher values produce smoother transitions.76 * @default 0.877 */78 smoothingTimeConstant?: number;79 /**80 * FFT size forwarded to the underlying `AnalyserNode`. Must be a power81 * of two.82 * @default 25683 */84 fftSize?: number;85 /**86 * Maximum number of samples retained in scrolling mode.87 * @default 6088 */89 historySize?: number;90 /**91 * Minimum interval in milliseconds between audio samples.92 * @default 3093 */94 updateRate?: number;95 /**96 * `"static"` renders a symmetric frequency-band visualization; `"scrolling"`97// … truncated
More from sv11-twango
All 29 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Audio Playeraudio-player | sv11-twango | Components | Free | 2 deps | |
| Bar Visualizerbar-visualizer | sv11-twango | Components | Free | no deps | |
| Conversationconversation | sv11-twango | Components | Free | 2 deps | |
| Conversation Barconversation-bar | sv11-twango | Components | Free | 1 dep | |
| Matrixmatrix | sv11-twango | Components | Free | no deps | |
| Messagemessage | sv11-twango | Components | Free | 2 deps | |
| Mic Selectormic-selector | sv11-twango | Components | Free | 1 dep | |
| Orborb | sv11-twango | Components | Free | 4 deps |
