Can't mute MS Teams and Skype audio processes using Win32 Core Audio API

Alexander Sh 1 Reputation point
2021-11-24T12:44:16.577+00:00

Hi everybody,
I need to mute (or set volume to 0) for all processes.
I use IAudioSessionControl2 interface for getting process Id and ISimpleAudioVolume for set mute (set volume to 0) form Win32 API.
Everything was fine, but about 6 months ago I had a problem with MS Teams and Skype. I couldn't mute them for some reason.
Maybe it is because they have two processes with the same process ID?
For example, when I get all audio processes I see (value is a volume)
{ name: 'Teams.exe', value: 1, id: 8776 },
{ name: 'Skype.exe', value: 0.5000076293945312, id: 26716 },
{ name: 'electron.exe', value: 0.7894737124443054, id: 35292 },
{ name: 'Teams.exe', value: 0.8026315569877625, id: 19996 },
{ name: 'qemu-system-x86_64.exe', value: 0.75, id: 35620 },
{ name: 'Skype.exe', value: 1, id: 38564 },
{ name: 'System Sounds', value: 0.8947368264198303, id: 0 },
{ name: 'Skype.exe', value: 1, id: 38564 },
{ name: 'Viber.exe', value: 0.75, id: 11356 },
{ name: 'Teams.exe', value: 1, id: 8776 }

as you see here are two Teams/Skype processes with the same ID. When I try to mute it doesn't work. I can see it on Volume Mixer.
Could somebody help me? Maybe there is another way to mute audio processes. But I guess that it is something wrong with Teams\Skype because it worked before.
Thanks!

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,132 questions
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,427 questions
Windows Hardware Performance
Windows Hardware Performance
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Hardware Performance: Delivering / providing hardware or hardware systems or adjusting / adapting hardware or hardware systems.
1,548 questions
{count} votes