AudioBits

Catalog and editable source

Install portable recipes and sound controllers through shadcn, then connect your application inputs.

The catalog lets you hear sounds, adjust their controls, and inspect their source. The GitHub source registry distributes that source into your application. audiobits supplies the runtime; the installed files supply sound behavior. Your application supplies events, state and presentation.

Recipes and experiences

A recipe is serializable, versioned sound data: sources, envelopes, filters, variation, and parameter mappings. It contains no UI or application state. Use a recipe for a button sound, notification, impact, or a sustained sound controlled by your own host. Simple sounds need no controller, including a sustained recipe driven directly by voice.set(). See the recipe reference.

An experience installs sound recipes, a reusable sound controller, and an integration guide. Try Energy Charge for application-supplied progress or Reactive Thruster for application-supplied throttle, or Lightsaber for motion and collision events. Echo Probe schedules a pulse and pulse-preserving, surface-colored returns from application-supplied distance, pan, intensity, and surface values. It separates material from propagation and adds a sparse late field with short native delay copies. The registry specifies the delay-capable runtime range. Rapid emissions prioritize new pulses and early returns over older tails. The Rift keeps a sustained field alive after an opening, shaped by application-supplied aperture, tension and instability, evolves it on its own with bounded audio-clock disturbances, and ends with a deliberate collapse. Riff Reactor plays an original synth-rock band on the audio clock in short lookahead batches, performs application-judged lead notes at their charted pitch, and moves between three arrangement tiers on bar lines. Its installed music helpers let you write pitches such as C4 or Bb3 in quarter-note beats, repeat phrases, and select editable instrument recipes independently of the song. See the Riff Reactor guide for notation, presets and note-length behavior. Pitch names and numbers describe tuning, while recipe layers, envelopes, transients and filters define timbre. Riff's picked-string and resonant-percussion palette uses those same primitives. Connect the controller to your application; complete browser demonstrations remain in the public repository. Echo Vision uses Echo Probe's existing sound controller in a dark 3D room. Application geometry supplies material, distance and direction; surfaces appear when their echoes return. Install Echo Probe for the sound source.

Groove Mixer loops a two-bar bass-and-drums beat at 120 BPM. Balance or mute drums, bass and the overall mix independently. Its installed controller owns lookahead scheduling and cancellation; your host owns activation, presentation and engine disposal. The website pairs drum pulses with a bass ribbon and a measured output scope.

Standalone instruments

Synth lead is a sustained pitched recipe with a short onset scoop, independent live pitch bend and brightness. Install it independently with npx shadcn@latest add joacod/audiobits/synth-lead. Its integration guide uses the installed createInstrument helper for note/velocity input, typed additional parameters, native Voice updates, scheduled release and cleanup. The manifest includes the recipe, guide and shared authoring helpers; it needs no Riff song or controller. Riff's previous helper imports remain reexports.

The starter band palette adds Rock drum kit, Picked bass, Electric guitar lead and Rhythm guitar. Install items independently by their catalog ID. The kit exports kick, snare, closed/open hats and crash; the workbench previews its kick. Lead guitar is sustained, with brightness and bend. Bass and rhythm guitar use fixed one-shot envelopes. Each rhythm-guitar voice plays one pitch, so chord phrases can supply separate notes. These synthesized approximations use the same pitch/instrument helpers, with no samples or new runtime dependency.

Riff Reactor's website selector keeps Reactor Core and adds a shortened instrumental Sweet Child O’ Mine adaptation. Switching stops the current session and resets the chart and score; a fresh stage gesture starts the selected song. The third-party song arrangement stays in the website, outside the reusable instrument catalog and the installed Riff source.

Install source

Discover and inspect an item

From an existing project with a package.json, list the registry and inspect a recipe before adding it:

npx shadcn@latest list joacod/audiobits
npx shadcn@latest view joacod/audiobits/confirmation

Add the editable source

Install the recipe you inspected:

npx shadcn@latest add joacod/audiobits/confirmation

For coordinated interactive sound, inspect an experience from the catalog and install its controller in the same way.

Review source and dependencies

These are shadcn GitHub registry addresses. The CLI resolves the repository's root registry.json and its declared files; there is no separate AudioBits registry server to configure. Each item declares audiobits in dependencies, so adding source also requests the npm runtime dependency. Current items share one compatible runtime line so adding another item cannot request an older line. Review dependency changes if your project already has AudioBits; compare the source requirements with your installed audiobits/capabilities.json. For runtime-only installation, use the quick start.

For a reproducible install, append # followed by a reviewed full commit SHA to the GitHub address. Without a ref, the CLI uses the default branch. Review existing-file overwrite prompts and retain your local changes when appropriate. Later catalog installs are source updates to review in version control.

Use top-level view for inspection. In an unconfigured project, add --dry-run, --diff, and --view can request component setup; decline unrelated setup and use top-level view instead.

Files you own

The items use explicit project-relative file targets. Normal installation needs no React, Tailwind, Next.js, or components.json. The source is TypeScript using public AudioBits exports and bundler module resolution, not precompiled JavaScript.

This tree shows representative targets for Confirmation and Energy Charge. Inspect the registry payload for the selected item's complete file manifest. Only the selected item's files are installed. Recipe items install their definition and any explicitly listed helpers and guide. Shared helpers install under src/sounds/helpers/. Experience installs exclude demo hosts and UI.

recipe.ts
recipe.ts
progress.ts
README.md

Application-owned source, npm runtime

Recipes and experiences become source you own and edit in your application. Catalog source is 0BSD-licensed, with no required license notices or credit. audiobits remains the MIT-licensed runtime dependency; builds and playback use local files and the runtime without registry access.

Integrate into your application

For Confirmation, import the installed definition from a host file in src/:

import { createAudio } from "audiobits";
import { confirmation } from "./sounds/recipes/confirmation/recipe";

const audio = createAudio();
const sound = audio.sound(confirmation);

Use this definition in place of the local tone in the quick start. Call audio.start() directly from a user gesture, await activation, then call sound.play(). Surface activation errors and allow a fresh gesture to retry. Provide Stop, invalidate pending starts on cancellation, suspend on hide, and dispose owned resources on navigation or unmount. The lifecycle guide explains those host responsibilities.

For an experience, use the included README's example from src/integration.ts. Keep installed relative imports intact. Controllers accept an application-owned engine and dispose only their own sounds and subscriptions. The application owns gesture activation, input/state mapping, suspension, and engine disposal. Supply finite normalized inputs: progress, throttle, movement and strike strength in [0, 1], with Lightsaber direction in [-1, 1] and elapsed time in milliseconds. Reactive Thruster takes throttle directly and does not require Impact; Lightsaber takes movement and collision events without a visual stage. Pointer handling, frame scheduling, canvas and 3D belong to your application.

Working consumer examples use the actual installed paths. Complete demonstrations and their visual/input adapters remain in the repository and on the public showcases. For a repository demo, see the standalone setup.

Adopt the sound you heard

Use the showcase's install action to add the selected item, then Copy usage to connect installed source to your existing controls. Recipe usage includes the current accepted definition, parameter values and seed; an edited recipe is embedded inline so the copied code plays that edit. Experience usage follows the installed controller guide. The installation command always installs the catalog source, so local edits must be copied or applied separately.

Workbench editor

Recipe workbenches expose JSON editing in the collapsed Recipe section. They accept at most 32 KiB of JSON and show the first ten validation issues. Apply explicitly; invalid input preserves the last valid playable sound. Applying valid data stops playback and disposes the old sound. Play again to hear the accepted definition.

Keep the playback kind and primary parameter's range, default and mode. Additional parameters use their declared defaults. Restore returns the recipe, controls and seed to catalog defaults; Reset variation changes only the seed.

Customize and verify

Edit the installed recipe.ts to change pitch, gain, envelopes, filters, or parameter mappings. Keep application state, input mapping, and visuals in your controller or host. Parameters explains live controls and seeded replay; buses explains shared routing and mute.

Validate adapted data with validateRecipe from your installed runtime, then run your application's typecheck and build. Check defaults and control extrema, gesture activation, errors, Stop, hiding, and teardown in the browser. Static validation does not prove audio playback or audible quality. AudioBits automated browser evidence targets Chromium.

For help adapting or creating source, use the official agent Skill.

On this page