private static void RegisterFocusStateWatch() { _focusStateWatchCallback = (id, options, focusState, reason, extraInfo, _) => { _streamFocusStateChanged?.Invoke(null, new StreamFocusStateChangedEventArgs(options, focusState, reason, extraInfo)); }; Interop.AudioStreamPolicy.AddFocusStateWatchCallback( AudioStreamFocusOptions.Playback | AudioStreamFocusOptions.Recording, _focusStateWatchCallback, IntPtr.Zero, out var cbId). ThrowIfError("Failed to initialize focus state event"); }
private static void RegisterFocusStateWatch() { _focusStateWatchCallback = (int id, AudioStreamFocusOptions options, AudioStreamFocusState focusState, AudioStreamFocusChangedReason reason, string extraInfo, IntPtr userData) => { _streamFocusStateChanged?.Invoke(null, new StreamFocusStateChangedEventArgs(options, focusState, reason, extraInfo)); }; Interop.AudioStreamPolicy.AddFocusStateWatchCallback( AudioStreamFocusOptions.Playback | AudioStreamFocusOptions.Recording, _focusStateWatchCallback, IntPtr.Zero, out var cbId). Validate("Failed to initialize focus state event"); }