AudioBits is currently tested in Chromium-based browsers. Other browsers are not yet verified.
Power-up
A rising triangle and sine halo that gather energy together.
Control position · Power intensity 50%
Power-up: ready
Audio: idle
Sound controls
Add to project
npx shadcn@latest add joacod/audiobits/power-upAdds 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 { powerUp } from "./sounds/recipes/power-up/recipe";
const audio = createAudio();
const sound = audio.sound(powerUp);
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.34,
"effects": [
{
"filter": "lowpass",
"frequency": 3600,
"q": 0.7,
"type": "filter"
}
],
"kind": "one-shot",
"layers": [
{
"envelope": {
"attack": 0.012,
"decay": 0.24,
"release": 0.08,
"sustain": 0.18
},
"gainDb": {
"control": "intensity",
"range": [
-24,
-18
],
"scale": "linear"
},
"id": "rise",
"source": {
"frequency": {
"curve": "exponential",
"points": [
[
0,
220
],
[
0.12,
440
],
[
0.27,
{
"control": "intensity",
"range": [
660,
880
],
"scale": "linear"
}
]
]
},
"type": "oscillator",
"waveform": "triangle"
}
},
{
"envelope": {
"attack": 0.06,
"decay": 0.2,
"release": 0.1,
"sustain": 0.08
},
"gainDb": -29,
"id": "halo",
"source": {
"frequency": {
"curve": "exponential",
"points": [
[
0,
{
"random": [
435,
445
]
}
],
[
0.14,
880
],
[
0.29,
1320
]
]
},
"type": "oscillator",
"waveform": "sine"
}
}
],
"parameters": {
"intensity": {
"default": 0.5,
"max": 1,
"min": 0,
"mode": "play"
}
},
"schemaVersion": 1
}