Jump to content

Creating a script to change default audio devices

ShadowWolf810

Hello all, 

 

I've been trying to find a good way to switch default audio devices without an extra program running in the background. Have stumbled upon nircmd before, but I'm trying to make it so that it takes up 1 hotkey (that I'll map with Logitech Gaming Software) and will toggle between my headset and my speakers. 

 

I tried modifying the script found here: https://gallery.technet.microsoft.com/scriptcenter/Cycle-through-default-7d438b9a#content which is a Powershell script instead of a .bat file, but for whatever reason I can't get it to work, Nircmd always comes up asking me to copy it to the C:\Windows but it is already there and it doesn't seem to recognize it.  

 

If anyone knows how to write a single bat file without AutoHotKey that will toggle between the two audio sources I'd really appreciate the help for I am an absolute n00b at any sort of programming/coding

Link to comment
Share on other sites

Link to post
Share on other sites

10 minutes ago, ShadowWolf810 said:

Hello all, 

 

I've been trying to find a good way to switch default audio devices without an extra program running in the background. Have stumbled upon nircmd before, but I'm trying to make it so that it takes up 1 hotkey (that I'll map with Logitech Gaming Software) and will toggle between my headset and my speakers. 

 

I tried modifying the script found here: https://gallery.technet.microsoft.com/scriptcenter/Cycle-through-default-7d438b9a#content which is a Powershell script instead of a .bat file, but for whatever reason I can't get it to work, Nircmd always comes up asking me to copy it to the C:\Windows but it is already there and it doesn't seem to recognize it.  

 

If anyone knows how to write a single bat file without AutoHotKey that will toggle between the two audio sources I'd really appreciate the help for I am an absolute n00b at any sort of programming/coding

I mean, I just use Window's built in audio thing.

Please spend as much time writing your question, as you want me to spend responding to it.  Take some time, and explain your issue, please!

Spoiler

If you need to learn how to install Windows, check here:  http://linustechtips.com/main/topic/324871-guide-how-to-install-windows-the-right-way/

Event Viewer 101: https://youtu.be/GiF9N3fJbnE

 

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, JefferyD90 said:

I mean, I just use Window's built in audio thing.

I gets annoying enough when its just me, I'd like to seamlessly be able to take off my headphones and go lay on my bed without pausing whatever I'm watching. That I don't mind putting up with.  

 

The main cause for me to want to do this is that I'm an editor and when working with on other peoples projects, very often they'll be sitting directly behind me watching as I work and as I finish a section they'd like to hear it so being able to just hit a key and not have to take off my headphones to hand to them, or go into the Control panel every 5 minutes would be amazing. 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, ShadowWolf810 said:

I gets annoying enough when its just me, I'd like to seamlessly be able to take off my headphones and go lay on my bed without pausing whatever I'm watching. That I don't mind putting up with.  

 

The main cause for me to want to do this is that I'm an editor and when working with on other peoples projects, very often they'll be sitting directly behind me watching as I work and as I finish a section they'd like to hear it so being able to just hit a key and not have to take off my headphones to hand to them, or go into the Control panel every 5 minutes would be amazing. 

Why are you going into the control panel?  You just have to right click on the task bar and its all right there.

Please spend as much time writing your question, as you want me to spend responding to it.  Take some time, and explain your issue, please!

Spoiler

If you need to learn how to install Windows, check here:  http://linustechtips.com/main/topic/324871-guide-how-to-install-windows-the-right-way/

Event Viewer 101: https://youtu.be/GiF9N3fJbnE

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, JefferyD90 said:

Why are you going into the control panel?  You just have to right click on the task bar and its all right there.

Ok that's besides the point. That's still 4 clicks to change a setting I constantly need changed. Even if I left the Sound panel open on the other monitor its still a pain in the ass to switch through constantly

Link to comment
Share on other sites

Link to post
Share on other sites

7 minutes ago, ShadowWolf810 said:

Ok that's besides the point. That's still 4 clicks to change a setting I constantly need changed. Even if I left the Sound panel open on the other monitor its still a pain in the ass to switch through constantly

I agree.  I'd like to see a script used here too.  I have a Logitech keyboard that has 6 "G-keys" that I never use.  I'd totally put them to use for when I switch between my projector and monitors.

Please spend as much time writing your question, as you want me to spend responding to it.  Take some time, and explain your issue, please!

Spoiler

If you need to learn how to install Windows, check here:  http://linustechtips.com/main/topic/324871-guide-how-to-install-windows-the-right-way/

Event Viewer 101: https://youtu.be/GiF9N3fJbnE

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, JefferyD90 said:

I agree.  I'd like to see a script used here too.  I have a Logitech keyboard that has 6 "G-keys" that I never use.  I'd totally put them to use for when I switch between my projector and monitors.

I just got that one I linked earlier mostly working. You can even set the default volume that the system is set to when you switch between the two. And in the logitech gaming software you can set it to run scripts. I'm not sure if it works with powershell scripts but even if it doesn't you can just make a shortcut and then set the target of the shortcut to be your script and I know that'll work. 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×