Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

@web-kits/audio

npm license CI

Declarative audio synthesis for the web. Describe sounds as plain objects, play them with one function call.

~11 kB gzipped, tree-shakeable, works with vanilla JS or React.

Install

npm install @web-kits/audio

Quick start

import { defineSound, ensureReady } from "@web-kits/audio"; const click = defineSound({ source: { type: "sine", frequency: { start: 1200, end: 300 } }, envelope: { attack: 0.001, decay: 0.06, sustain: 0, release: 0.03 }, gain: 0.3, }); await ensureReady(); click();

React

import { usePatch } from "@web-kits/audio/react"; function App() { const patch = usePatch("/patches/core.json"); return ( <button onClick={() => patch.play("click")} disabled={!patch.ready}> Click me </button> ); }

CLI

Browse and install community sound patches directly from GitHub repos:

# Browse the registry npx @web-kits/audio add # Install from a GitHub repo npx @web-kits/audio add user/repo # Create a new patch npx @web-kits/audio init # List installed patches npx @web-kits/audio list

Monorepo structure

packages/audio       Core library + CLI (published to npm)
apps/web             Documentation, registry, and homepage
ui/                  Shared UI components
.web-kits/           First-party sound patches & generated code

Documentation

Full docs at audio.raphaelsalaja.com.

References

Contributing

See CONTRIBUTING.md for setup instructions and guidelines.

License

MIT

关于 About

Declarative audio synthesis for the web
audiodeclarativenextjsreactsound-designsynthesizertypescriptui-soundsweb-audioweb-audio-api

语言 Languages

TypeScript78.1%
CSS9.5%
MDX8.5%
JavaScript2.5%
Python1.4%
SCSS0.1%

提交活跃度 Commit Activity

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

核心贡献者 Contributors