{"_id":"@web-kits/audio","_rev":"3-134047ff9545002aa500ebf28ec6b00a","name":"@web-kits/audio","dist-tags":{"latest":"0.2.0"},"versions":{"0.0.1":{"name":"@web-kits/audio","version":"0.0.1","keywords":["audio","sound","synthesizer","web-audio","declarative","ui-sounds"],"author":{"name":"Raphael Salaja"},"license":"MIT","_id":"@web-kits/audio@0.0.1","maintainers":[{"name":"raphaelsalaja","email":"raphaelsalaja@gmail.com"}],"homepage":"https://github.com/raphaelsalaja/audio-kit","bugs":{"url":"https://github.com/raphaelsalaja/audio-kit/issues"},"bin":{"audio":"dist/bin.js"},"dist":{"shasum":"65b193ca9bd13e877880ec7a411f477123f8b4bc","tarball":"https://registry.npmjs.org/@web-kits/audio/-/audio-0.0.1.tgz","fileCount":9,"integrity":"sha512-8LCn0c4Dvph1RG8ejscueJZl3cqxEyTkgDEgaFC56dIS9UYjgedHr1GBDIrghKJs29NQznU5o5iQbhBLa0TnCA==","signatures":[{"sig":"MEQCIC634C1GCAiaQu476C/qlwOx2FeraGndOFE5C3K37wFbAiAk0XV5rVDXi1gQ0bBS5lo2UNi5cDnqx4rGFnYERvPx8g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":167851},"main":"./dist/index.js","type":"module","_from":"file:web-kits-audio-0.0.1.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./bin":"./dist/bin.js","./react":{"types":"./dist/react.d.ts","default":"./dist/react.js"},"./package.json":"./package.json","./schemas/pack.schema.json":"./schemas/pack.schema.json"},"scripts":{"dev":"bunchee --watch","lint":"biome check --fix --unsafe .","test":"vitest run","build":"bunchee","typecheck":"tsc --noEmit"},"_npmUser":{"name":"raphaelsalaja","email":"raphaelsalaja@gmail.com"},"_resolved":"/private/var/folders/sm/p05lq2nn4jd15ydyprjbt0b40000gn/T/321ca1fe4587d643284accd33312becd/web-kits-audio-0.0.1.tgz","_integrity":"sha512-8LCn0c4Dvph1RG8ejscueJZl3cqxEyTkgDEgaFC56dIS9UYjgedHr1GBDIrghKJs29NQznU5o5iQbhBLa0TnCA==","repository":{"url":"git+https://github.com/raphaelsalaja/audio-kit.git","type":"git"},"_npmVersion":"11.6.2","description":"A declarative synthesizer for the web","directories":{},"sideEffects":false,"_nodeVersion":"25.1.0","dependencies":{"picocolors":"^1.1.1","@clack/prompts":"^0.9.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"react":"^19.0.0","vitest":"^4.1.3","bunchee":"latest","typescript":"^5.9.3","@types/react":"^19.0.0"},"peerDependencies":{"react":">=18"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/audio_0.0.1_1775733953358_0.9091005860201558","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@web-kits/audio","version":"0.1.0","keywords":["audio","sound","synthesizer","web-audio","declarative","ui-sounds"],"author":{"name":"Raphael Salaja"},"license":"MIT","_id":"@web-kits/audio@0.1.0","maintainers":[{"name":"raphaelsalaja","email":"raphaelsalaja@gmail.com"}],"homepage":"https://github.com/raphaelsalaja/audio","bugs":{"url":"https://github.com/raphaelsalaja/audio/issues"},"bin":{"audio":"dist/bin.js"},"dist":{"shasum":"bcc089cd33f24234d659c34f2b404aff9f72b277","tarball":"https://registry.npmjs.org/@web-kits/audio/-/audio-0.1.0.tgz","fileCount":10,"integrity":"sha512-jaS9Z6MSilo4SN9dUpztvqZhRkJWd8ABcB38Vdqpsh5UbKxYUBC9qq0a/YUC+RPzG8Iy5/wpycIV4d18ewX0rg==","signatures":[{"sig":"MEQCIAW5c+JzrMpFilY8+jXpRU49+UpJEbsomEalMA001M/xAiA6RUORYq4CckHWjwrgO710xtAPIpxipVewQX0r6uqY7A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":203258},"main":"./dist/index.js","type":"module","_from":"file:web-kits-audio-0.1.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./bin":"./dist/bin.js","./react":{"types":"./dist/react.d.ts","default":"./dist/react.js"},"./package.json":"./package.json"},"scripts":{"dev":"bunchee --watch","lint":"biome check --fix --unsafe .","test":"vitest run","build":"bunchee","typecheck":"tsc --noEmit"},"_npmUser":{"name":"raphaelsalaja","email":"raphaelsalaja@gmail.com"},"_resolved":"/private/var/folders/sm/p05lq2nn4jd15ydyprjbt0b40000gn/T/abab9d19f74cdcc2104248852a0d9614/web-kits-audio-0.1.0.tgz","_integrity":"sha512-jaS9Z6MSilo4SN9dUpztvqZhRkJWd8ABcB38Vdqpsh5UbKxYUBC9qq0a/YUC+RPzG8Iy5/wpycIV4d18ewX0rg==","repository":{"url":"git+https://github.com/raphaelsalaja/audio.git","type":"git"},"_npmVersion":"11.6.2","description":"A declarative synthesizer for the web","directories":{},"sideEffects":false,"_nodeVersion":"25.1.0","dependencies":{"picocolors":"^1.1.1","@clack/prompts":"^0.9.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"react":"^19.0.0","vitest":"^4.1.3","bunchee":"latest","typescript":"^5.9.3","@types/node":"^25.2.3","@types/react":"^19.0.0"},"peerDependencies":{"react":">=18"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/audio_0.1.0_1776683485674_0.15771793068287643","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"_id":"@web-kits/audio@0.2.0","bin":{"audio":"dist/bin.js"},"bugs":{"url":"https://github.com/raphaelsalaja/audio/issues"},"dist":{"shasum":"28ec3e87760e1e3ad4264662aefd2d508013bd2e","tarball":"https://registry.npmjs.org/@web-kits/audio/-/audio-0.2.0.tgz","fileCount":10,"integrity":"sha512-4naddQeSNBPsgQUEoCqes9jlNg3u+XDYu8x73I9YcxuWIdN1YhCSR+ANtOE61vllU55EY7e/eVKc48rsIRieSw==","signatures":[{"sig":"MEYCIQCVUz3QIwPdl4NUmB/RJfLON9TZg8DuVI+shpokD41ZqAIhAOyQCEi68ga2GTrwBMp0mHsd/exvBUF4qD6JOm/c7xoe","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHraeQrScdArA7att98wtwWv/yZek0CunEB4ChaDqILqAiEAoJJWsPizU4CBhSXbWjKs4A+vYOauXElCmhAJZE4OCkI="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@web-kits%2faudio@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":205725},"main":"./dist/index.js","name":"@web-kits/audio","type":"module","_from":"file:web-kits-audio-0.2.0.tgz","types":"./dist/index.d.ts","author":{"name":"Raphael Salaja"},"engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./bin":"./dist/bin.js","./react":{"types":"./dist/react.d.ts","default":"./dist/react.js"},"./package.json":"./package.json"},"license":"MIT","scripts":{"dev":"bunchee --watch","lint":"biome check --fix --unsafe .","test":"vitest run","build":"bunchee","typecheck":"tsc --noEmit"},"version":"0.2.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:455abe1c-d482-4840-801b-1b4e31289599"}},"homepage":"https://github.com/raphaelsalaja/audio","keywords":["audio","sound","synthesizer","web-audio","declarative","ui-sounds"],"_resolved":"/tmp/31b401583ef5a0eb7468ceaadcb0b9ca/web-kits-audio-0.2.0.tgz","_integrity":"sha512-4naddQeSNBPsgQUEoCqes9jlNg3u+XDYu8x73I9YcxuWIdN1YhCSR+ANtOE61vllU55EY7e/eVKc48rsIRieSw==","repository":{"url":"git+https://github.com/raphaelsalaja/audio.git","type":"git"},"_npmVersion":"11.19.0","description":"A declarative synthesizer for the web","directories":{},"maintainers":[{"name":"raphaelsalaja","email":"raphaelsalaja@gmail.com"}],"sideEffects":false,"_nodeVersion":"24.20.0","dependencies":{"picocolors":"^1.1.1","@clack/prompts":"^0.9.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"react":"^19.0.0","vitest":"^4.1.3","bunchee":"latest","typescript":"^5.9.3","@types/node":"^25.2.3","@types/react":"^19.0.0"},"peerDependencies":{"react":">=18"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/audio_0.2.0_1788650444831_0.6062786475266353"}}},"time":{"created":"2026-04-09T11:25:53.242Z","modified":"2026-09-05T23:20:45.287Z","0.0.1":"2026-04-09T11:25:53.496Z","0.1.0":"2026-04-20T11:11:25.814Z","0.2.0":"2026-09-05T23:20:44.936Z"},"bugs":{"url":"https://github.com/raphaelsalaja/audio/issues"},"author":{"name":"Raphael Salaja"},"license":"MIT","homepage":"https://github.com/raphaelsalaja/audio","keywords":["audio","sound","synthesizer","web-audio","declarative","ui-sounds"],"repository":{"url":"git+https://github.com/raphaelsalaja/audio.git","type":"git"},"description":"A declarative synthesizer for the web","maintainers":[{"name":"raphaelsalaja","email":"raphaelsalaja@gmail.com"}],"readme":"# @web-kits/audio\n\nDeclarative audio synthesis for the web. Describe sounds as plain objects, play them with one function call.\n\n## Install\n\n```bash\nnpm install @web-kits/audio\n```\n\n## Usage\n\n### Define and play a sound\n\n```ts\nimport { defineSound, ensureReady } from \"@web-kits/audio\";\n\nconst pop = defineSound({\n  source: { type: \"sine\", frequency: { start: 1200, end: 300 } },\n  envelope: { attack: 0.001, decay: 0.06, sustain: 0, release: 0.03 },\n  gain: 0.3,\n});\n\nawait ensureReady();\npop();\n```\n\n### Shorthand helpers\n\n```ts\nimport { sine, noise } from \"@web-kits/audio\";\n\nconst beep = sine(440, 0.1);\nconst click = noise(\"white\", 0.02);\n\nbeep();\nclick();\n```\n\n### Sound patches (React)\n\n```tsx\nimport { usePatch } from \"@web-kits/audio/react\";\n\nfunction App() {\n  const patch = usePatch(\"/patches/core.json\");\n\n  return (\n    <button onClick={() => patch.play(\"click\")} disabled={!patch.ready}>\n      Click me\n    </button>\n  );\n}\n```\n\n### Sound patches (vanilla)\n\n```ts\nimport { loadPatch } from \"@web-kits/audio\";\n\nconst patch = await loadPatch(\"/patches/core.json\");\npatch.play(\"click\");\n```\n\n## CLI\n\n```bash\n# Browse and install patches from the registry\nnpx @web-kits/audio add\n\n# Install patches from a GitHub repo\nnpx @web-kits/audio add user/repo\n\n# Create a new sound patch\nnpx @web-kits/audio init\n\n# List installed patches\nnpx @web-kits/audio list\n\n# Remove installed patches\nnpx @web-kits/audio remove\n```\n\n## Patch authoring\n\nCreate a patch JSON file with `npx @web-kits/audio init`, then add sound definitions to the `sounds` object:\n\n```json\n{\n  \"$schema\": \"node_modules/@web-kits/audio/schemas/patch.schema.json\",\n  \"name\": \"my-patch\",\n  \"sounds\": {\n    \"click\": {\n      \"source\": { \"type\": \"noise\", \"color\": \"white\" },\n      \"filter\": { \"type\": \"bandpass\", \"frequency\": 2000 },\n      \"envelope\": { \"decay\": 0.05 }\n    }\n  }\n}\n```\n\nPush it to a GitHub repo. Others can install it with:\n\n```bash\nnpx @web-kits/audio add your-username/your-repo\n```\n\n## API\n\n| Export | Description |\n|--------|-------------|\n| `defineSound(def)` | Create a reusable play function from a sound definition |\n| `ensureReady()` | Initialize the audio context (call before first play) |\n| `sine(freq, decay)` | Shorthand for sine oscillator |\n| `triangle(freq, decay)` | Shorthand for triangle oscillator |\n| `square(freq, decay)` | Shorthand for square oscillator |\n| `sawtooth(freq, decay)` | Shorthand for sawtooth oscillator |\n| `noise(color, decay)` | Shorthand for noise generator |\n| `loadPatch(url)` | Load a sound patch from a URL |\n| `definePatch(json)` | Create a patch from a JSON object |\n| `usePatch(url)` | React hook for loading and playing patches |\n\n## Documentation\n\nFull docs at [audio.raphaelsalaja.com](https://audio.raphaelsalaja.com).\n\n## License\n\n[MIT](https://github.com/raphaelsalaja/audio/blob/main/LICENSE)\n","readmeFilename":"README.md"}