AudioBits is currently tested in Chromium-based browsers. Other browsers are not yet verified.
Reactive thruster
Move to shape a living sound. Release to coast.
Add to project
npx shadcn@latest add joacod/audiobits/reactive-thrusterAdds editable source and the audiobits runtime dependency. Installation guide
Installs the catalog defaults and sound controller. The website visuals and input system stay in the showcase.
Use this sound
Use in src/integration.ts. Call play() from a user gesture and handle activation errors. Connect updates to application state; stop on cancellation or hiding, and dispose on removal.
import { createAudio } from "audiobits";
import { createThruster } from "./sounds/experiences/reactive-thruster/pointer";
const audio = createAudio();
const thruster = createThruster(audio);
let request = 0;
export async function play() {
const token = ++request;
await audio.start();
if (token !== request) return;
thruster.start(0.2);
}
export function update(value: number) {
thruster.setThrottle(value);
}
export function stop() {
request++;
thruster.stop();
}
export async function dispose() {
stop();
thruster.dispose();
await audio.dispose();
}
Production lifecycleCustomize or inspect
Connect your application's state and events to the sound controller. The full showcase source includes the browser host, input, and visuals.
View complete public source