Hotkey to Switch Audio Devices on Windows

Modern Windows 10 and 11 versions have plenty of various hotkeys that automate tasks and allow doing things much faster. However, for some reason, there is no hotkey for switching audio devices. Instead, customers need to use the Settings app and the outdated Control Panel.

Fortunately, third-party apps can save the day. If you switch between different audio devices frequently, creating a dedicated hotkey will make your life much easier. There are several ways to change audio devices with a hotkey in Windows 10 and 11, and this article will list the most convenient ones.

Note. Although we use Windows 10 and 11, the most recent and the only supported versions, this guide also applies to Windows 7.

How to Switch Audio Devices in Windows 10/11?

Before we dig deeper into creating an audio device switch hotkey in Windows 10 and 11, let us show you how to toggle between audio output devices in Microsoft’s latest operating systems. Here is how you do that in Windows 11:

  1. Press Win + A or click the network/volume/battery button in the bottom-right corner.
  2. Click the icon with a speaker next to the volume slider. autohotkey change audio device
  3. Select the desired audio output device. autohotkey switch audio output

You can also take another route:

ADVERTISEMENT
  1. Open Windows Settings by pressing Win + I and go to the System section.
  2. Click Sound. ahk change audio output
  3. Select an audio output device from the Choose where to play sound drop-down list. script to change audio device

Finally, you can use the old Control Panel (this will also work in Windows 10, 8.1, 8, and 7):

  1. Press Win + R and type control.
  2. Navigate to Hardware and Sound > Sound. switch audio device hotkey
  3. On the Playback tab, right-click the desired output device and select Set as default Device. hotkey to change sound device

Now let us show you how to create a hotkey or shortcut for audio device switching in Windows 10 and 11.

Change Audio Devices with Hotkey using AutoHotkey

You can create hotkeys for switching audio devices in Windows 10 and 11 using the AutoHotkey app. It is a popular automation tool that lets you create custom shortcuts using different scripts. AutoHotkey app is free; you can download it from the official website.

  1. Download and install AutoHotkey from the official website.
  2. Click Install on the first screen. You can leave everything as is and not change the installation properties. windows hotkey change audio device
  3. Click New script and give the file a name. You can keep it in the default location. autohotkey play sound
  4. Click Create.
  5. AutoHotkey will open a new File Explorer window with your script. Open the script in Notepad.
  6. Copy and paste the following script into Notepad:
    *F6::

    Run, mmsys.cpl

    WinWait,Sound

    ControlSend,SysListView321,{Down 4}

    ControlClick,&Set Default

    ControlClick,OK

    return

    *F7::

    Run, mmsys.cpl

    WinWait,Sound

    ControlSend,SysListView321,{Down 3}

    ControlClick,&Set Default

    ControlClick,OK

    return
  7. Press Win + R and type mmsys.cpl.
  8. Note the order of your playback devices on the Playback tab. For example, in the screenshot below, the default speakers are seventh on the list. Therefore, change {Down 4} to {Down 7}. The number in the brackets indicates how many times AutoHotkey should click down to select the needed audio output device. switch playback device hotkey windows 10
  9. Note the number of the second audio device and change its {Down} value in the second part of the script accordingly.
  10. Another thing worth noting is that the script above assigns one output device to the F6 key and another to the F7 key. Replace F6 and F7 in the script with the keys you want if necessary.
    windows script to change audio output
  11. Save the script and run it. Now you can switch between your audio devices with the F6 and F7 keys.

How to Switch Between Audio Devices in Windows 10 and 11?

AutoHotkey is a powerful app that can do marvels with skilled hands. However, it is also not for inexperienced users who have no time to learn how scripting works. If you need something more user-friendly and intuitive, here are two apps that will make switching audio devices in Windows 10 and 11 a breeze.

  1. Download the EarTrumpet app from the Microsoft Store. It is a free, open-source app for managing sound on Windows 10 and 11.
  2. Installing the app will place a new volume indicator in the notification area. You can hide the stock indicator if you use Windows 10. If you use Windows 11, you will have to deal with two volume indicators on the taskbar.
  3. Right-click EarTrumpet’s icon in the notification area and select the desired audio output device.

Another app is Audio Switcher. It is also free and open source; you can download it from the official website. Unlike EarTrumpet, Audio Switcher lets you manage both playback and recording devices.

  1. Download Audio Switcher from the official website. If downloading from the official website does not work, use the GitHub page.
  2. Open the zip archive and extract the AudioSwitcher.exe file to a convenient location. Installation completed!
  3. Run the executable file. Right-click the AudioSwitcher icon and select Open Preferences.
  4. Place a checkmark next to the Start when Windows starts option. It will ensure Audio Switcher works whenever your PC is running.
  5. Place a checkmark next to the Show Default Playback Device icon in tray option. autohotkey change sound device
  6. Place a checkmark next to the Start minimized option.
  7. Open the Playback tab and specify which device should be your default audio output. autohotkey switch audio device
  8. Now you can switch between headphones and speakers in just two clicks: right-click the Audio Switcher icon in the notification area and select the desired playback device from the pop-up list.

Now here is how to assign shortcut keys for switching audio devices in the Audio Switcher app:

  1. Go to the Playback tab and right-click the audio device.
  2. Select Set Hot Key.
    switch audio output windows 10 hotkey
  3. Click Hot Key and type the necessary shortcut or a single key. Make sure you use available shortcuts to avoid conflicts with other features and apps.
  4. Click Save.

And that is how you change audio devices in Windows 10 and 11 with shortcut keys.

I enjoy technology and developing websites. Since 2012 I'm running a few of my own websites, and share useful content on gadgets, PC administration and website promotion.
Latest posts by Cyril Kardashevsky (see all)

52 comments

  1. Thanks this was exactly what I was looking for. I have a 3 screen set up. 2 monitors on my desk and a HD TV. The main computer monitor and HD TV are clones using an HDMI splitter. I use the TV when I’m laying on the couch or watching youtube/movies from the computer. It was a pain having to always go into sound options and switch form computer speakers and TV speakers constantly. Now all I do is hit a button and it’s done! Tip for others: After you change the code be sure to right click the program and select reload script! :D

    1. Thanks! Yes, I have been using this non-stop at work to switch between my primary speakers and headphones :) Actually saves a lot of time if you add up all the times you have to switch. I edited the post and added the ‘reload script’ part. I forgot to do that :) Thanks.

  2. Hi for some reason this script only opens the sound device selection window. when i press either hotkey. i followed all steps i only have 2 sound devices so i set it to 1 and 2. what is wrong?

      1. OK figured it out.. after poking around a bit. i had to change

        WinWait,Sound to WinWait,Ljud
        and
        ControlClick,&Set Default to ControlClick,&Standard

        which it is int swedish version of windows.

        but a toggle would still be nice :)

          1. Your very welcome… seeing from Google translator… I’m assuming you said the following?? “Thanks for the help there, Hannes! Now it works!”

    1. *F8::
      Run, mmsys.cpl
      WinWait,Sound
      Send {TAB 3}{RIGHT}
      ControlSend,SysListView321,{Down 1}
      ControlClick,&Set Default
      ControlClick,OK
      return

      Follow the directions in the original how-to to change the hotkey and determine your recording device number.

      Protip: Change playback and recording devices in one swoop
      *F6::
      Run, mmsys.cpl
      WinWait,Sound
      ControlSend,SysListView321,{Down 3}
      ControlClick,&Set Default
      ControlClick,OK
      Run, mmsys.cpl
      WinWait,Sound
      Send {TAB 3}{RIGHT}
      ControlSend,SysListView321,{Down 1}
      ControlClick,&Set Default
      ControlClick,OK
      return

      *F7::
      Run, mmsys.cpl
      WinWait,Sound
      ControlSend,SysListView321,{Down 2}
      ControlClick,&Set Default
      ControlClick,OK
      Run, mmsys.cpl
      WinWait,Sound
      Send {TAB 3}{RIGHT}
      ControlSend,SysListView321,{Down 2}
      ControlClick,&Set Default
      ControlClick,OK
      return

    2. I used this to disable/enable my mic, but you can modify to change your default recording device:

      #z::
      Run, mmsys.cpl
      WinWaitActive,Sound ; Wait for window to appear
      Control,TabRight, 1, SysTabControl321 ; Select second tab
      Sleep 10 ; Wait for tab, modify as needed
      ControlSend,SysListView321, {Down 1} ; In the list of devices, select the mic to disable
      Send {Shift}+{f10} ; Right-click
      Sleep, 20 ; Wait for menu, modify as needed
      SendPlay {Down} ; Arrow down to Disable/Enable
      Send {Enter} ; Select
      ;ControlClick OK ; Exit

      Hope it helps,

  3. Like Hannes already found out, the script as it is here only works for english versions of windows.
    So for everyone who hadn’t figured it out form the post, the hints for how to make this work for any language version of windows are in the script.

    1; after WinWait, the word should be the same as the name of your audio panel(on top it says the name: Sound in English, Ljud in Swedish and in my case, Geluid in Dutch)
    2; after ControlClick, the text should be the same as the center button on the audio panel, the one to set the dafault ( Set Default in English, Standard in English, Als standaard instellen in Dutch)

    This should get you to figure it out in any language, and remember to pay attention to capitals.

  4. Great Stuff, after some enhancements from Hannes June 15 it’s working perfect!
    Also I agree with Hannes – to toggle the source would be really nice ;-)

  5. It is working fine, but my sound device is keep changing one to another automatically so when i open windows media player sound is discontinued in second interval. Try disabling the second digital audio device but result is same, pls help me

  6. Hi, thx for this, it’s really helpfull, i was just wondering if there is also a way to get not altabbed when playing a game for example and you pres f6 or f7?

  7. For all non-english windows users; you have to change the file according to the following pattern:
    ControlClick,&***
    where *** is what the drop-down button in sound devices says when a non-standard device is selected,
    WinWait,#
    where # is the term that is used instead of “sound” in your windows version.

    For example, in german Win7 it’s
    WinWait,Sound
    ControlClick,&Als Standard

    1. Skrypt zmieniający automatycznie domyślne urządzenie audio w win7:
      For Polish UI working code is:

      *F6::
      Run, mmsys.cpl
      WinWait,Dźwięk
      ControlSend,SysListView321,{Down 1}
      ControlClick,&Ustaw domyślne
      ControlClick,OK
      return

      *F7::
      Run, mmsys.cpl
      WinWait,Dźwięk
      ControlSend,SysListView321,{Down 2}
      ControlClick,&Ustaw domyślne
      ControlClick,OK
      return

  8. SOmehow it doesn`t work for me i follow the steps excactly as you say i did it again but nothing when i press the fuction keys it just open the panel of the playback devices and that all the command stops there

    1. i guess i have to change the commands in my language but still nothing does the script understands the Greek characters?

  9. A way to toggle this would be fantastic, is there a way to have it check if one is currently active and then switch to the one which is not active? Out of two chosen devices of course, if this can be done it would help me greatly as I’d like to only have one macro key taken up with this.

  10. Even simpler is to use FastKeys, It handles this very well plu has tons of other features – you can even import full AHK scripts. Check fastkeys.vze.com.

  11. Would be useful if you could type it out so I could copy and paste it in to avoids typos and misreading etc. Thanks.

  12. SoundSwitch didn’t exist when we originally wrote this. I just gave that a try and it works great! We just edited our article and put your suggestion at the bottom of the post. Thanks for your comment!

  13. I Brian!

    I’ve been trying for 2h now to make this to work and without success…

    My default windows language is “Portuguese”.

    I’ved tried everything i could think off…

    The portuguese word for “sound” is “Som”.
    Thanks

  14. For Windows 8 small change is required (because of two default output devices, for playback and communication):

    *F6::
    Run, mmsys.cpl
    WinWait,Sound
    ControlSend,SysListView321,{Down 4}
    ControlClick,&Set Default
    ControlSend,SysListView321,{Down 1}
    ControlClick,OK
    return

    *F7::
    Run, mmsys.cpl
    WinWait,Sound
    ControlSend,SysListView321,{Down 3}
    ControlClick,&Set Default
    ControlSend,SysListView321,{Down 1}
    ControlClick,OK
    return

  15. Hi! This script has worked for me beautifully! Thanks! But I want to ask, how do I do the same thing, but for recording devices? What part of the script would I have to replace? Thanks again!

  16. For the Finnish Windows 8.1 users:

    *F6::
    Run, mmsys.cpl
    WinWait,Ääni
    ControlSend,SysListView321,{Down 3}
    ControlClick,&Aseta oletus
    ControlSend,SysListView321,{Down 1}
    ControlClick,OK
    return

    *F7::
    Run, mmsys.cpl
    WinWait,Ääni
    ControlSend,SysListView321,{Down 2}
    ControlClick,&Aseta oletus
    ControlSend,SysListView321,{Down 1}
    ControlClick,OK
    return

  17. How do you change the order in which devices are listed? Everytime I plug in a headset the order changes and everything goes to hell.

  18. This worked perfectly! I love ahk!!! Thank you.

    btw to avoid accidental keypresses I switched the *F6 to +F6 which is shift + F6 pressed together as the hot key.

  19. Hi, this did now work for me.

    The only way I can switch between my speakers and headphones is if I disable the other. Is there a script where you can enable/disable speakers and my G930 headset?

    Thank you

  20. If you need it to toggle here is a simple switch:

    soundSwitch = 1

    *F2::

    Run, mmsys.cpl
    WinWait,Sound
    if soundSwitch = 1
    {
    ControlSend,SysListView321,{Down 1}
    ControlClick,&Set Default
    ControlClick,OK
    soundSwitch = 2
    }
    else
    {
    ControlSend,SysListView321,{Down 2}
    ControlClick,&Set Default
    ControlClick,OK
    soundSwitch = 1
    }
    return

    put that into your autohotkey.ahk and press F2 :)

  21. Thanks for the great script! Windows 10 requires slightly different action for the default button though, as it now has a drop down.

    *F6::
    Run, mmsys.cpl
    WinWait,Sound
    ControlSend,SysListView321,{Down 2} ; This is my headphones
    ControlFocus,&Set Default
    Send,{Down 2}
    Send,{Enter}
    ControlClick,OK
    return
    *F7::
    Run, mmsys.cpl
    WinWait,Sound
    ControlSend,SysListView321,{Down 3} ; This is the laptop speakers
    ControlFocus,&Set Default
    Send,{Down 2}
    Send,{Enter}
    ControlClick,OK
    return

    I mapped my headphones to ^!h and speakers to ^!s. (I use ctrl-alt-key so as to not interfere with Visual Studio)

  22. With this should work in all languages
    I have windows 10 italian, couldn’t make the script working
    you only need to change:
    WinWait, Sound <— change SOUND with the title of the window in your language
    example: in italian: WinWait, Audio
    and of course change the number of your device

    Run, mmsys.cpl
    WinWait,Sound
    ControlSend,SysListView321,{Down 3}
    Send !{E}
    ControlClick,OK
    return

  23. With this should work in all languages
    I have windows 10 italian, couldn’t make the script working
    you only need to change:
    WinWait, Sound <— change SOUND with the title of the window in your language
    example: in italian: WinWait, Audio
    and of course change the number of your device

    Run, mmsys.cpl
    WinWait, Sound ;change with the title of window in your language
    ControlSend,SysListView321,{Down 3} ;change with the device you need to change
    Send !{E} ;change E, explained below
    ControlClick,OK
    return

    ps. info for the E or other key:
    1. open the audio device window
    2. click ALT key
    3. now only a letter in buttons is underlined
    4. that mean you are able to activate this button with: ALT + (underlined letter) key combination
    5. change the script with the letter you need

    ps. this same comment was detected as spam. wtf?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.