Batch file to change default audio device

Page 1 of 2 12 LastLast

  1. Posts : 6
    Windows 7 64bit
       #1

    Batch file to change default audio device


    Hi all,

    I have my computer hooked up to a home theater system. Most of the time, my computer audio output is set to my on-board motherboard audio connected to simple speakers, but I frequently switch the default device to digital output through my sound card (HTO Striker 7.1).

    My goal is to create a file that I can keep on the desktop that will switch the default audio device. In a perfect world, it would switch back and forth between the 2 settings that I use, but I understand that it might be too much to ask for.

    I have a bit of experience with batch files in XP, but that was essentially reverse-engineering things that I found online. Any help would be appreciated. Thanks
      My Computer


  2. Posts : 5,605
    Originally Win 7 Hm Prem x64 Ver 6.1.7600 Build 7601-SP1 | Upgraded to Windows 10 December 14, 2019
       #2

    Hi! Mr D, welcome to 7F :)

    Would hotkeys fill the bill?

    Source: AutoHotkey - Free Mouse and Keyboard Macro Program with Hotkeys and AutoText
      My Computer


  3. Posts : 6
    Windows 7 64bit
    Thread Starter
       #3

    I'm hopefully looking for a solution that does not involve an additional program. I have a Logitech G11 keyboard, which has 18 customizable macro keys and its own macro program. I don't think there is a way within the Logitech program to change the default audio device, but I could be wrong, and I'll take a closer look
      My Computer


  4. Posts : 5,605
    Originally Win 7 Hm Prem x64 Ver 6.1.7600 Build 7601-SP1 | Upgraded to Windows 10 December 14, 2019
       #4

    Understood if you have a keyboard that can do that, you would not want additional programs.

    Take a look at this, It shows how to program the G-11 macros, and at the bottom it even describes how to include mouse clicks that would be very helpful during your programming of changing the sound devices.

    Legacy Software - Programming macros on my G11 keyboard
      My Computer


  5. Posts : 6
    Windows 7 64bit
    Thread Starter
       #5

    Thanks for the link. I think that once I have a file that can change the audio device, I can easily link to it through a macro. As far as I can tell, there is no way to access the terminal through the macro program, and even if there was, I need to figure out what commands to use.
      My Computer


  6. Posts : 5,605
    Originally Win 7 Hm Prem x64 Ver 6.1.7600 Build 7601-SP1 | Upgraded to Windows 10 December 14, 2019
       #6

    Your welcome, but I do not understand your difficulty.

    It would seem to me that once you start the macro program on the G-11 you would then preform the actions you do now to change from the on-board to the sound card whether or not it included a mixture of keys or clicks, then you save that macro as, lets say 'S_C' for Sound_Card to a key or key combo.

    To change back to the on-board you start a fresh G-11 macro, preform the actions to do that, save that macro as 'O_B' to a key or key combo, and your done.

    Not knowing the G-11 macro program it may even allow you to save the macro as a shorcut to your desktop, but I did not read that far.

    Am I missing anything? That is how I used to make macros in Excel, and I had some doozys that would jump across several workbooks, files, and then to the printer.
      My Computer


  7. Posts : 6
    Windows 7 64bit
    Thread Starter
       #7

    The problem is that my current way of selecting the default audio device is to right-click on the sound icon, choose "playback devices", and then select the correct device. The macro program can record "mouse actions", which is restricted to the buttons and scroll, nothing about moving around the screen and doing something this complicated.

    I've done what you are describing in Excel, but Visual Basic is a more powerful language, and never requires any mouse movement/actions.
      My Computer


  8. Posts : 5,605
    Originally Win 7 Hm Prem x64 Ver 6.1.7600 Build 7601-SP1 | Upgraded to Windows 10 December 14, 2019
       #8

    That is just it, it does not need to track movement, it should just record your next click. What does it care how you get there it just needs to know your next choice.

    What does it hurt to try?

    I gotta go we are having a bad lighting storm and I am shutting down for the night.
      My Computer


  9. Posts : 6
    Windows 7 64bit
    Thread Starter
       #9

    The macro program can only track simple mouse commands. If I were to press record and then do what I normally do, the result would look like this:

    Right-Click
    Left-Click
    Left-Click
    Left-Click

    I believe that I could create a macro that would go through the start menu, open audio devices, and then change the default using keystrokes, but that is not very efficient, and could be easily messed up by an accidental keystroke in the middle. I am really hoping for something like this:

    1) Macro Button activates a specific batch file (I can do this part)
    2) Batch file uses terminal commands to change the audio device (hopefully without extra windows being opened)

    It seems to me that there should be a relatively simple command that changes the default audio device from the terminal, but I do not have enough experience to know what it is.
      My Computer


  10. Posts : 6
    Windows 7 64bit
    Thread Starter
       #10

    I just found this: Changing default audio deviceThey have some solutions that will quickly open the sound menu and select a different device. This is adequate, but if anyone knows a solution that does not rely on opening new windows, that would be preferable.
      My Computer


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 07:32.
Find Us