{"record":{"id":"57631c5c3e1359a7","repo":"moeru-ai/airi","slug":"system-audio-lipsync-is-not-available-in-this-runt","errorCode":null,"errorMessage":"System audio lipsync is not available in this runtime","messagePattern":"System audio lipsync is not available in this runtime","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/stage-ui/src/stores/system-audio-lipsync.ts","lineNumber":100,"sourceCode":"    available.value = true\n  }\n\n  /** Removes a renderer-specific runtime if it is still the current owner. */\n  function clearDriver(currentDriver: SystemAudioLipSyncDriver): void {\n    if (driver !== currentDriver)\n      return\n\n    stop()\n    driver = undefined\n    available.value = false\n  }\n\n  /** Starts this Live2D consumer without affecting other system audio consumers. */\n  async function start(): Promise<void> {\n    if (isRequested.value || isStarting.value)\n      return\n    if (!driver)\n      throw new Error('System audio lipsync is not available in this runtime')\n\n    isStarting.value = true\n    error.value = undefined\n    try {\n      await driver.start(currentOptions(), {\n        onOutput(output) {\n          inputLevel.value = output.inputLevel\n          mouthOpen.value = output.mouthOpen\n        },\n        onEnded() {\n          isActive.value = false\n          isRequested.value = false\n          inputLevel.value = 0\n          mouthOpen.value = 0\n        },\n      })\n      isActive.value = true\n      isRequested.value = true","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/moeru-ai/airi/blob/9c213115f8bd0fff9e6eabab02b077ac32da21be/packages/stage-ui/src/stores/system-audio-lipsync.ts#L82-L118","documentation":"The system audio lipsync store lazily resolves a platform `driver` (browser/electron-specific audio capture + lipsync backend). When start() is called and no driver was registered for the current runtime, it throws rather than silently doing nothing, so consumers can show feedback. Other system audio consumers are unaffected.","triggerScenarios":"Calling start() (e.g. enabling lipsync for a Live2D model) in an environment where the driver was never injected — unsupported browser, Electron main-side service not wired, or the module loaded before the driver registration ran.","commonSituations":"Using the feature in a browser that lacks the required audio capture API; Electron preload/IPC bridge not initialized so the driver factory returned undefined; SSR or test environment without the platform implementation.","solutions":["Check `isSupported`/driver availability from the store before calling start(), and hide or disable the lipsync toggle when unsupported.","Ensure the platform driver registration module is imported/executed on the app's entry path (Electron preload wiring or browser feature module).","Upgrade or run in an environment that provides the required audio capture API (e.g. Chromium-based runtime).","Catch this error in the UI and surface a fallback (no lipsync) instead of crashing the enable flow."],"exampleFix":"// before\nawait startLipsync()\n// after\ntry {\n  await startLipsync()\n}\ncatch (error) {\n  console.warn('Lipsync unavailable:', errorMessageFrom(error))\n}","handlingStrategy":"try-catch","validationCode":"if (!lipsyncStore.isSupported) {\n  console.warn('System audio lipsync unavailable in this runtime')\n  return\n}","typeGuard":null,"tryCatchPattern":"try {\n  await lipsync.start()\n}\ncatch (error) {\n  error.value = errorMessageFrom(error)\n  disableLipsyncUi()\n}","preventionTips":["Expose an isSupported flag from the store and gate the feature UI on it.","Ensure driver registration modules are imported on all entry paths (browser, Electron renderer, tests).","Provide a graceful no-lipsync fallback so the rest of the app keeps working.","Document which runtimes/browsers support system audio lipsync."],"tags":["runtime","lipsync","feature-availability","audio"],"backgroundTag":"feature-not-supported-in-runtime","analyzedSha":"9c213115f8bd0fff9e6eabab02b077ac32da21be","analyzedAt":"2026-09-02T04:27:24.639Z","contentChangedAt":"2026-09-02T04:27:24.639Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}