there is (at least in my opinion) no easy way to check that.
I wrote a service, which checks the Teams application every few hundred miliseconds.
But neither the window, nor the process gives you any hint if you are on the phone or not.
So I ended up checking the notifyicon´s tooltip in the taskbar. But you have to change it to be displayed all the time (Info: Symbols to show on taskbar...).
With that, it´s possible to get the current state like:
- On phone
- New Activity
- In meeting
What I did then, was to react on every state to unmute my WiFi Radio, except on "New activity" or "In a meeting".
Mute is set on "On Phone" or "Presentation".
Another way would be to use Microsoft Graph to check your current state online. But this would require a quite powerful access to you companies Azure Online domain (if you have any).
I´m not allowed to get such a deep access, so I did it the way described above.
To go the same way, you have to transfer the data from your application/service to the Arduino via serial. I just send out a mute command to a webservice.