{"record":{"id":"98726c3121ab35e0","repo":"babalae/better-genshin-impact","slug":"error-98726c","errorCode":null,"errorMessage":"进程音频接口激活失败","messagePattern":"进程音频接口激活失败","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/AutoSkip/Audio/ProcessLoopbackAudioCapture.cs","lineNumber":367,"sourceCode":"                    {\n                    }\n                }\n            }\n        }\n\n        public IAudioClient WaitForAudioClient()\n        {\n            if (!_completed.Wait(TimeSpan.FromSeconds(5)))\n            {\n                throw new TimeoutException(\"等待进程音频接口激活超时\");\n            }\n\n            if (_exception != null)\n            {\n                throw _exception;\n            }\n\n            return _audioClient ?? throw new InvalidOperationException(\"进程音频接口激活失败\");\n        }\n\n        public void Dispose()\n        {\n            _disposed = true;\n            _completed.Dispose();\n        }\n    }\n}\n","sourceCodeStart":349,"sourceCodeEnd":377,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoSkip/Audio/ProcessLoopbackAudioCapture.cs#L349-L377","documentation":"InvalidOperationException from WaitForAudioClient: the completion event WAS signaled within 5s and no exception was stored, yet _audioClient is null. This happens when ActivateCompleted ran, GetActivateResult/activateResult succeeded, but `activatedInterface as IAudioClient` returned null (the async operation returned an object that is not an IAudioClient) without throwing — the InvalidCastException in the handler would instead surface via _exception.","triggerScenarios":"COM activation returned a non-IAudioClient interface for the requested IID; the ActivateAudioInterfaceAsyncNative call used an incorrect audioClientId GUID; partial/unsupported Windows build returns a placeholder interface; race where handler was disposed (_disposed) between Set and read but _completed still got set by an earlier path.","commonSituations":"Running on an older Windows 10 build that lacks full PROCESS_LOOPBACK support; IID mismatch after an API refactor; antivirus/security hook interfering with COM marshaling.","solutions":["Update to a recent Windows 10/11 build (process loopback activation requires a supported release).","Confirm typeof(IAudioClient).GUID is the canonical IID_IAudioClient and not accidentally overridden.","Check Windows Event Viewer for COM/activation errors at the failure time.","Fall back to a different capture backend or disable the audio-based AutoSkip feature on unsupported builds."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { client = handler.WaitForAudioClient(); }\ncatch (InvalidOperationException e) when (e.Message.Contains(\"进程音频接口激活失败\"))\n{ /* unsupported build / COM issue — disable feature */ }","preventionTips":["Feature-detect PROCESS_LOOPBACK support (Windows build) before enabling audio skip.","Pin the IAudioClient IID to the canonical value and unit-test the activation path.","Ship a fallback silent-skip path so audio failure does not block the whole task."],"tags":["audio","wasapi","com","activation"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}