Detect if user has muted/unmuted microphone in messengers (Skype, Discord, Telegram) with C# on application level?

BOBOLLI 0 Reputation points
2023-03-28T15:31:12.22+00:00

I am writing a program to collect a Windows user actions data: clicks, outlook meetings, microphone and webcamera usage, etc. Something close to key logger, but with additions.

I have a task to collect data if user has muted or unmuted his microphone or turned on/off his web camera during a call in messengers: like Skype, Telegram or Discord, for example.

I know that i can collect data from registry by path

\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore{camera/microphone}\NonPackaged

There is written data of which apps have asked access to a microphone or web camera and device usage time start and stop. But it does not tell if user`s microphone or web camera were actually used (user could mute them during a call).

Is there any way to get data if users microphone and web camera were actually used and were not turned off during calls? Any low level Win32 functions? Is it even possible, or device data stream of application cannot be accessed?

Developer technologies | C#
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 90,686 Reputation points
    2023-03-28T17:12:47.81+00:00

    At application level, you can use ISimpleAudioVolume::GetMute

    (I had posted a test sample in C++ in this thread https://learn.microsoft.com/en-us/answers/questions/1155953/trouble-accessing-an-my-defaultaudioendpoint, which can be converted into C# with P/Invoke)


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.