Does AHK have the ability to change audio device settings in Windows? (Windows 7 Ultimate x64)
Specifically, I'm trying to automate the ability to change "Speaker Configuration" and "Default Format" in the Windows Sound control panel (because Windows keeps resetting my speakers to Stereo-2.1 and format to 16bit/44k).
Can AHK change audio device settings...?
- Coldblackice
- Posts: 29
- Joined: 13 Nov 2013, 14:39
Re: Can AHK change audio device settings...?
seems the registry is different for each audio device so i cant offer a generic answer. but if you can isolate the registry entries and correct values you can use to edit the setting.
Code: Select all
RegWrite, ValueType, RootKey, SubKey , ValueName, Value
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
Re: Can AHK change audio device settings...?
I'm facing the same problem, i want to be able to switch between my Headset and my Speakers, setting the headset as default...
So far, only way to do is either manually, or devcon, don't know if nircmd setting the default audio device will work the same as enabling disabling it.
Manually, is a pain in the arse
Devcon can only disable the hardware completely, not only the output
nircmd, don't really know how it behaves
we should probably be able to sent command line parameters to mmsys.cpl so we can disable the 1st device, so the speakers may can play the sound, and re-enable to get audio on the headset, as turning it off doesn't help at all, only unplugging or disabling the output / hardware does the trick...
If anyone has any insight on the matter, help will be appreciated...
So far, only way to do is either manually, or devcon, don't know if nircmd setting the default audio device will work the same as enabling disabling it.
Manually, is a pain in the arse
Devcon can only disable the hardware completely, not only the output
nircmd, don't really know how it behaves
we should probably be able to sent command line parameters to mmsys.cpl so we can disable the 1st device, so the speakers may can play the sound, and re-enable to get audio on the headset, as turning it off doesn't help at all, only unplugging or disabling the output / hardware does the trick...
If anyone has any insight on the matter, help will be appreciated...
- Coldblackice
- Posts: 29
- Joined: 13 Nov 2013, 14:39
Re: Can AHK change audio device settings...?
The problem, so far as I'm dealing with, is that "new" devices are created when certain monitor types are turned off/on (i.e., HDMI + DisplayPort). So I'm unable to do much with the registry, short of some type of "relative" adjustments rather than absolute -- e.g., "Lock the first subkey from ever changing" (assuming the "new" monitors' keys are always piled on from the same direction).
Thus, I think the way to do it might be through a quasi-"manual" activation, where AHK is essentially navigating through the Audio Settings dialogs -- but ideally able to do so without the GUI interface being used. Anyone know if this is doable via command line? That'd be fantastic if audio devices could be configured/switched/adjusted via commandprompt!
Thus, I think the way to do it might be through a quasi-"manual" activation, where AHK is essentially navigating through the Audio Settings dialogs -- but ideally able to do so without the GUI interface being used. Anyone know if this is doable via command line? That'd be fantastic if audio devices could be configured/switched/adjusted via commandprompt!
Re: Can AHK change audio device settings...?
That's what i was thinking, back in the Win98 days, there was a lot of knowledge about dll calls to execute commands (like a shutdown, volume up, and stuff like that), it occurs to me, maybe there's a way to do something similar with control panel applets.Coldblackice wrote: Thus, I think the way to do it might be through a quasi-"manual" activation, where AHK is essentially navigating through the Audio Settings dialogs -- but ideally able to do so without the GUI interface being used. Anyone know if this is doable via command line? That'd be fantastic if audio devices could be configured/switched/adjusted via commandprompt!
I tried to capture windows messages, but there's no way to lock into this applets (cannot find parrent window or something like that).
Re: Can AHK change audio device settings...?
nircmd definitely works, I can vouch for for that, like I said here (I don't know how people missed my post) and when I use devcon it asks for reboot so it's not an option. like said in my post even nircmd method isn't fully foolproof it just changes the default audio device if anyone wants I can post a full procedure
Re: Can AHK change audio device settings...?
I noticed nircmd, problem is, last time i tried, you had to restart your programs for the audio to be effectively channeled through the correct device, disabling my headset in the Soun / Playback Properties does not, only if the program requeres exclusive access, like a videogame...dsdsds12 wrote:nircmd definitely works, I can vouch for for that, like I said here (I don't know how people missed my post) and when I use devcon it asks for reboot so it's not an option. like said in my post even nircmd method isn't fully foolproof it just changes the default audio device if anyone wants I can post a full procedure
I will try again.
Re: Can AHK change audio device settings...?
The Vista Audio library is very relevant to this discussion
http://www.autohotkey.com/board/topic/2 ... functions/
http://www.autohotkey.com/board/topic/2 ... functions/
Re: Can AHK change audio device settings...?
In particular, this post.
Re: Can AHK change audio device settings...?
each and every one of those programs, scripts etc will only allow us to switch default audio device but, what we want is to disable one of those device like a said in my previous post. I've been googling for weeks now, I justcouldn't understand why isn't there is a script for something as simple as this
Re: Can AHK change audio device settings...?
http://go4answers.webhost4life.com/Exam ... 25844.aspx
answer 4 is correct for the registry but it seems you have to be admin and might need to start and stop some service
answer 4 is correct for the registry but it seems you have to be admin and might need to start and stop some service
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
Re: Can AHK change audio device settings...?
Try this. I'm not sure if it will work. I can't try because I'm on my mobile.
(Chaz is my name on the other forum.)
Edit: Nope, doesn't work.
(Chaz is my name on the other forum.)
Edit: Nope, doesn't work.
Re: Can AHK change audio device settings...?
@tank so there is no way via AHK
@timeFlies any attempt to disable a device via device manager requires a reboot
@timeFlies any attempt to disable a device via device manager requires a reboot
Re: Can AHK change audio device settings...?
That isnt what i said at all but if your unable to explore the suggestion it may be just as true
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
- Coldblackice
- Posts: 29
- Joined: 13 Nov 2013, 14:39
Re: Can AHK change audio device settings...?
What about changing a device's number of channels/speakers? The links posted so far have been helpful, but I still have yet to find anything pointing to how to accomplish this. Any ideas?