Determine if windows is currently playing sound
Here is a sample C# code that determines if Windows is rendering any audio stream. It uses Windows Core Audio API (specifically the IAudioMeterInformation interface) and is supported on Vista and higher. public static bool IsWindowsPlayingSound() { var enumerator = (IMMDeviceEnumerator)(new MMDeviceEnumerator()); var speakers = enumerator.GetDefaultAudioEndpoint(EDataFlow.eRender, ERole.eMultimedia); var meter = (IAudioMeterInformation)speakers.Activate(typeof(IAudioMeterInformation).GUID, 0, IntPtr.Zero); var value … Read more