Public
Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md
audiocn: Audio UI, mixed and mastered. A five-channel mixer with level meters and faders, rotary knobs and a waveform.

Audio components for React, built the shadcn way.
Level meters, visualizers, faders, knobs, channel strips, a complete mixer, players and sound pads.
Copy, paste, make them yours.

23 components 6 blocks 16 hooks MIT licence

React 19.2 shadcn/ui registry Tailwind CSS v4 Built on Base UI Web Audio API

Docs · Installation · Components · Blocks · Theming

Why audiocn

  • You own the code. It is not a package. Like shadcn/ui, every component is copied into your project with the shadcn CLI, so you can change anything.
  • Themed by shadcn. Built on Base UI, styled with Tailwind CSS and themed with the same CSS variables as shadcn/ui. Any shadcn theme restyles audiocn.
  • Fast by default. Meters and visualizers paint on the animation frame without re-rendering React, so a mixer with many channels stays smooth.
  • Bring your own audio. Components receive levels and values; they never open a microphone themselves. Use the included Web Audio hooks, or feed them from any other engine.
  • Real units. Mixer components speak decibels, the way audio engineers do.
  • Accessible. Keyboard control on every fader, knob and strip, real ARIA roles and reduced-motion support.

Components

Mixer: channel strips, shared metering and keyboard navigation.Level Meter: peak and RMS, stereo channels, peak hold and clip detection.
Knob: a rotary control with drag, keyboard input and an editable value.Waveform: a static waveform of a clip with a playhead, seeking, regions and markers.
Electric Waveform: a white-hot core with branching arcs.Electric Bar Visualizer: frequency-band bars drawn as crackling filaments.
Spectrum: a frequency spectrum analyser with axes, a grid and peak hold.Smooth Waveform: one clean line that follows the sound.
Audio Player: transport, seeking, time, volume, rate and loop.Sound Pad: trigger pads with modes, hotkeys, progress and accent colours.
All 23 components

Meters and visualizers

ComponentWhat it does
Level MeterPeak and RMS meter with zones, peak hold, a scale, a readout and a clip light
dB ScaleTick marks and labels for a decibel range, shared by meters and faders
dB ReadoutA numeric level label that updates at a readable rate and never shifts the layout
Clip IndicatorA clip light that holds after the signal clips, with a count and click to reset
Bar VisualizerBars driven by frequency bands, with idle, loading and mirrored modes
Electric Bar VisualizerBars as crackling filaments, with arcs between loud neighbours and sparks
Electric WaveformOne electric line with a white-hot core, a tall glow, forks and sparks
Smooth WaveformA clean line that follows the sound, as a flowing wave or an oscilloscope trace
Live WaveformA canvas waveform of a live signal, as scrolling history or the current frame
WaveformA clip's waveform with a playhead, seeking, hover time, regions and markers
SpectrumA frequency spectrum analyser with axes, a grid and peak hold

Controls

ComponentWhat it does
FaderA volume fader in decibels, with tapers, detents, a scale, reset and an editable value
Parameter SliderA labelled slider with a numeric input, unit, marks and reset
KnobA rotary control for dense layouts, drawn in SVG
Pan ControlLeft and right balance with a fill from the centre and a centre detent
Channel ToggleMute, solo and monitor buttons with their own pressed colours
Volume ControlA simple volume slider with a mute button, for players
Audio Device SelectA microphone, speaker or source picker with permission and disconnected states

Mixer

ComponentWhat it does
Channel StripOne mixer channel, as a row or a console strip, composed from the parts you need
MixerThe container for channel strips, with shared meter settings and keyboard navigation

Sounds and music

ComponentWhat it does
Audio PlayerA composable player with transport, seeking, time, volume, rate, loop and shortcuts
Track ListTracks with active and playing states and arrow-key navigation
Sound PadA trigger pad with modes, a hotkey, playback progress and an accent colour

Blocks

Complete, working audio features composed from the components. Drop one in and ship.

System Audio Mixer: microphone, system audio, music, sound pads and a master, running on Web Audio.Music Player: a playlist player with a waveform seek bar, shuffle, repeat and ducking.
Soundboard: sound pads with hotkeys, modes, volume, stop all and drag-and-drop.Microphone Setup: a device selector, live preview, meter, gain, mute and level check.
Quick Audio Popover: microphone and system audio controls behind one toolbar button.System Audio Settings: capture, volume and a meter for system audio.

Hooks

Web Audio plumbing so the components have something to show. Use them, or feed the components from your own engine.

HookWhat it does
useMicrophoneOpen a microphone as a MediaStream, with browser processing off by default
useSystemAudioCapture system or tab audio through the browser's screen-share picker
useAudioAnalyserMeter and visual frame sources from a stream, media element or AudioNode
useWebAudioMixerBind mixer state to a Web Audio graph, with ducking, monitor sends and a limited master
useMixerGain, mute, solo, pan and monitor per channel, plus a master, with no audio attached
useAudioPlayerPlayback state for an audio element the hook owns
useSoundLow-latency playback of short sounds decoded into memory
useWaveformDataDecode an audio file and reduce it to cached waveform peaks
useAudioDevicesAudio input or output devices, with permission state and live updates
useDemoSignalSynthetic speech, music, tone or noise, for previews, prototypes and tests

Plus useAudioContext, useFrameSource, useLevel, useClipHold, useReducedMotion and useAudioConfig.

Quick start

audiocn is a shadcn registry. You need React 19.2 or later, Tailwind CSS v4 and a project set up with shadcn/ui.

1. Add the registry to components.json:

{
  "registries": {
    "@audiocn": "https://audiocn.dev/r/{name}.json"
  }
}

2. Add components. The CLI copies each one with everything it depends on: the audio core, the audio theme tokens and any hooks it uses.

npx shadcn@latest add @audiocn/level-meter
npx shadcn@latest add @audiocn/system-audio-mixer

3. Use them.

import { LevelMeter } from "@/components/ui/level-meter";

export const MicLevel = ({ peakDb }: { peakDb: number }) => (
  <LevelMeter aria-label="Microphone level" peakDb={peakDb} />
);

Full guide: audiocn.dev/docs/installation.

Develop

This repository is the docs site, the registry source and the component source in one Next.js app.

PathWhat it is
components/ui/Components (audiocn's and the shadcn ones the site uses)
components/blocks/Blocks
hooks/Hooks
lib/audio/The audio core
components/examples/Docs previews
content/docs/Docs pages (Fumadocs MDX)
registry.jsonThe registry; pnpm registry:build writes public/r/
plans/The plan and component specs
pnpm install
pnpm dev              # docs site on http://localhost:3000
pnpm test             # unit and component tests (Vitest)
pnpm test:e2e         # browser tests (Playwright)
pnpm test:install     # installs every registry item into a fresh app and type-checks it
pnpm typecheck
pnpm check            # lint and format check (Ultracite)
pnpm build            # examples, registry and site
pnpm og:build         # regenerate the social cards in public/og/

The screenshots in this README are the social cards captured at 2x into .github/readme/. pnpm og:build refreshes them alongside the social images.

Licence

MIT


Built by fortysevenfx and orcdev with 🪓🪓

关于 About

Audio UI components for React, built the shadcn way.

语言 Languages

TypeScript87.1%
MDX10.4%
JavaScript1.5%
CSS1.0%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
195
Total Commits
峰值: 195次/周
Less
More

核心贡献者 Contributors