AudioBits is currently tested in Chromium-based browsers. Other browsers are not yet verified.
Gentle rejection
Two soft descending tones for an unavailable action.
Gentle rejection: ready
Audio: idle
Add to project
npx shadcn@latest add joacod/audiobits/gentle-rejectionAdds 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 { gentleRejection } from "./sounds/recipes/gentle-rejection/recipe";
const audio = createAudio();
const sound = audio.sound(gentleRejection);
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();
}
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.2,
"effects": [
{
"filter": "lowpass",
"frequency": 1800,
"q": 0.7,
"type": "filter"
}
],
"kind": "one-shot",
"layers": [
{
"envelope": {
"attack": 0.008,
"decay": 0.13,
"release": 0.055,
"sustain": 0.1
},
"gainDb": -19,
"id": "answer",
"source": {
"frequency": {
"curve": "exponential",
"points": [
[
0,
420
],
[
0.15,
300
]
]
},
"type": "oscillator",
"waveform": "sine"
}
},
{
"envelope": {
"attack": 0.014,
"decay": 0.15,
"release": 0.06,
"sustain": 0.04
},
"gainDb": -28,
"id": "undertone",
"source": {
"frequency": {
"curve": "exponential",
"points": [
[
0,
630
],
[
0.16,
450
]
]
},
"type": "oscillator",
"waveform": "sine"
}
}
],
"schemaVersion": 1
}