AudioBits is currently tested in Chromium-based browsers. Other browsers are not yet verified.
Impact
A descending body and filtered noise transient. Intensity changes pitch, brightness, and level.
Control position · Intensity 50%
Impact: ready
Audio: idle
Sound controls
Add to project
npx shadcn@latest add joacod/audiobits/impactAdds editable source and the audiobits runtime dependency. Installation guide
Installs the catalog defaults. The usage below reflects your current settings and applied edits.
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 { impact } from "./sounds/recipes/impact/recipe";
const audio = createAudio();
const sound = audio.sound(impact);
let request = 0;
// Use in src/integration.ts. Call play() from a user gesture; handle errors.
export async function play() {
const token = ++request;
await audio.start();
if (token !== request) return;
sound.play({ parameters: {"intensity":0.5}, seed: 42 });
}
export function stop() {
request++;
audio.stopAll({ tails: "cut" });
}
// Call on navigation/unmount.
export async function dispose() {
stop();
sound.dispose();
await audio.dispose();
}
Production lifecycleCustomize or inspect
Recipe
Apply valid JSON edits to hear and copy them. Copy Recipe returns the applied definition; the Add command installs catalog defaults.
{
"duration": 0.22,
"kind": "one-shot",
"layers": [
{
"envelope": {
"attack": 0.003,
"decay": 0.16,
"release": 0.05,
"sustain": 0.02
},
"gainDb": {
"control": "intensity",
"range": [
-22,
-12
],
"scale": "linear"
},
"id": "body",
"source": {
"frequency": {
"curve": "exponential",
"points": [
[
0,
{
"control": "intensity",
"range": [
100,
220
],
"scale": "linear"
}
],
[
0.12,
48
]
]
},
"type": "oscillator",
"waveform": "triangle"
}
},
{
"effects": [
{
"filter": "lowpass",
"frequency": {
"control": "intensity",
"range": [
900,
4200
],
"scale": "exponential"
},
"q": 0.7,
"type": "filter"
}
],
"envelope": {
"attack": 0.002,
"decay": 0.04,
"release": 0.01,
"sustain": 0
},
"gainDb": -24,
"id": "transient",
"source": {
"color": "white",
"type": "noise"
}
}
],
"parameters": {
"intensity": {
"default": 0.5,
"max": 1,
"min": 0,
"mode": "play"
}
},
"schemaVersion": 1
}