tonhowtf/omniget · warning

[omnidisc] ducking failed

Error message

[omnidisc] ducking failed

What it means

Logged by setDucking() when `omnidisc_voice_set_ducking` fails. The percent is clamped to 0-100 before the call; on failure the ducking level on the backend is unchanged, but the new value is still persisted to settings, which can desync preference vs. reality. Non-fatal.

Solutions

  1. Read errorText(e) for the backend reason.
  2. Only persist ducking_percent when the invoke succeeds, keeping settings in sync.
  3. Check that the audio backend supports attenuation/ducking on this platform.
  4. Ensure the voice session is active before applying ducking, or apply on session start from saved settings.
  5. Verify `omnidisc_voice_set_ducking` is registered and accepts { percent }.

Example fix

// before
try {
  await invoke("omnidisc_voice_set_ducking", { percent: clamped });
} catch (e) {
  console.warn("[omnidisc] ducking failed", errorText(e));
}
await updateSettings({ omnidisc: { voice: { ducking_percent: clamped } } });
// after
try {
  await invoke("omnidisc_voice_set_ducking", { percent: clamped });
  await updateSettings({ omnidisc: { voice: { ducking_percent: clamped } } });
} catch (e) {
  console.warn("[omnidisc] ducking failed", errorText(e));
}
Defensive patterns

Strategy: try-catch

Validate before calling

const clamped = Math.min(100, Math.max(0, Math.round(percent)));
if (!Number.isFinite(percent)) return;

Type guard

function isValidPercent(p: number): boolean {
  return Number.isFinite(p) && p >= 0 && p <= 100;
}

Try / catch

try {
  await invoke("omnidisc_voice_set_ducking", { percent: clamped });
  await updateSettings({ omnidisc: { voice: { ducking_percent: clamped } } });
} catch (e) {
  console.warn("[omnidisc] ducking failed", errorText(e));
}

Prevention

When it happens

Trigger: Calling setDucking(percent) when the backend command rejects: ducking/attenuation not supported by the audio backend, voice session not active, or handler error.

Common situations: Adjusting the ducking slider while not in a voice channel; audio backend without attenuation support; command not registered; browser dev mode.

Understand the failure class

Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.

Related errors


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/c90bbc380dcc756e. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/stores/omnidisc-voice-store.svelte.ts:713

      "omnidisc_voice_ptt_status",
    );
    pttRegistered = status.binding ? status.registered : null;
  } catch (e) {
    pttRegistered = null;
    console.warn("[omnidisc] push-to-talk status unavailable", errorText(e));
  }
}

export async function setVadThreshold(db: number): Promise<void> {
  await updateSettings({ omnidisc: { voice: { vad_threshold_db: db } } });
}

export async function setDucking(percent: number): Promise<void> {
  const clamped = Math.min(100, Math.max(0, Math.round(percent)));
  try {
    await invoke("omnidisc_voice_set_ducking", { percent: clamped });
  } catch (e) {
    console.warn("[omnidisc] ducking failed", errorText(e));
  }
  await updateSettings({ omnidisc: { voice: { ducking_percent: clamped } } });
}

export async function setRelayOnly(enabled: boolean): Promise<void> {
  await updateSettings({ omnidisc: { voice: { relay_only: enabled } } });
}

export function isE2ee(): boolean {
  return session?.e2ee === true;
}

export function pushToTalk(pressed: boolean) {
  invoke("omnidisc_voice_ptt", { pressed }).catch(() => undefined);
}

export async function setMicTest(on: boolean): Promise<string | null> {
  try {

View on GitHub (pinned to 8600b91f42)