Comments (1)
I ended up solving it like this:
$Microphone = "{0.0.1.00000000}.{50486949-aae2-4574-97fb-4660fd26b6f7}"
$Headset = "{0.0.1.00000000}.{4bf15a7e-d091-4bcb-ae8f-5cadfdcffca7}"
while (1) {
$ActiveDevice = Get-AudioDevice -Recording
$HeadSetObject = Get-AudioDevice -ID $Headset
$HeadSetIsMuted = $HeadSetObject."Device"."AudioEndpointVolume"."Mute"
if ($HeadSetIsMuted) {
if ($ActiveDevice."ID" -eq $HeadSet) {
Set-AudioDevice -ID $Microphone
}
} else {
if ($ActiveDevice."ID" -eq $Microphone) {
Set-AudioDevice -ID $Headset
}
}
sleep 3;
}
This is device dependant though. $HeadSetObject."Device"."AudioEndpointVolume"."Mute"
changes for the physical mute of my headset, but not for the physical mute of my microphone. You gotta test it out if you want to use it.
from audiodevicecmdlets.
Related Issues (20)
- Get-AudioDevice -PlaybackCommunication HOT 4
- Change status of non-default audio device HOT 1
- [Feature-Request] Include disabled/disconnected devices in Get-AudioDevice -List
- Feature Request - Disable Audio Device like it is possible in mmsys.cpl
- [Feature Request] Control over Communication's "Reduce The Volume" feature.
- [Feature Request] Set Endpoint Friendly Name.
- [Feature Request] Get and Set sampling rate and bit depth
- Write-AudioDevice should be able to adjust -[Timespan]SampleInterval and return floats HOT 3
- Write-AudioDevice should support -Multichannel
- Write-AudioDevice internal cleanup
- Write-AudioDevice should not use parameter sets
- "Get-AudioDevice -List" throws 0x80070490 Exception HOT 2
- Get-AudioDevice -PlaybackVolume returns a string not a float
- Feature Request: - Set Audio Device Format HOT 1
- Feature Request: get/set balance
- Windows 11 22631.3085 stopped working HOT 5
- [Feature Request] Listen to this device, reset
- [Feature Request] Set-AudioDevice should take in a name
- [Feature request] Show sound volume bar when calling Set-AudioDevice -PlaybackVolume
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from audiodevicecmdlets.