Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
Change 'Playback Devices' in Control Panel (Sound)
Change 'Playback Devices' in Control Panel (Sound)
I have my system setup where I watch WMC on a connected display and a have Toslink cable running to my receiver. Most of the time I use my computer with the speakers so it's annoying when WMC changes the device to digital audio but neglects to change it back when I close out.
Is there a way to do this in EG?
Side--I have tried VistaAudioChanger but had to nix it for being too buggy...sometimes it changed the audio, other times it just displayed that it did in the program but the setting remained in Sound.
Is there a way to do this in EG?
Side--I have tried VistaAudioChanger but had to nix it for being too buggy...sometimes it changed the audio, other times it just displayed that it did in the program but the setting remained in Sound.
Re: Change 'Playback Devices' in Control Panel (Sound)
tstack77
I am also interested in how to do this in EventGhost.
I have Vista x64 and EventGhost 0.3.7.r1436
I have found a vb script on this website : http://social.technet.microsoft.com/For ... a84acec1ed
I have modified it for my system, but I would rather have it controlled
by EventGhost via a python script, any python script GURU's around
please download the attached file and convert it to python, Please.
Also how would one run this vb script from EventGhost?
Thanks
Scat
I am also interested in how to do this in EventGhost.
I have Vista x64 and EventGhost 0.3.7.r1436
I have found a vb script on this website : http://social.technet.microsoft.com/For ... a84acec1ed
I have modified it for my system, but I would rather have it controlled
by EventGhost via a python script, any python script GURU's around
please download the attached file and convert it to python, Please.
Also how would one run this vb script from EventGhost?
Thanks
Scat
- Attachments
-
- How to change default sound device with a VBScript.zip
- User Note: Use at your own risk, view in notepad prior to using. I didn't create the scrips.
- (1.11 KiB) Downloaded 239 times
- jitterjames
- Experienced User
- Posts: 677
- Joined: Thu Aug 13, 2009 4:36 pm
- Location: Quebec, Canada
- Contact:
Re: Change 'Playback Devices' in Control Panel (Sound)
you can do something similar like this:
(note you can paste this code into your macro tree in eventghost and then it will be easier to understand what is going on too...)
It is doing the same thing as the vbscript basically, by emulating keyboard input. I don't know how reliable it is.
Note that I am using 1 down to select the first audio device, by using two or more downs you get the other devices...
if you want to use the vbscript you can execute it from eventGhost as you would any other file by creating an action going to "system" and choosing "start application", and then entering the path and filename or using the browse button.
(note you can paste this code into your macro tree in eventghost and then it will be easier to understand what is going on too...)
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1194">
<Macro Name="output = headset" Expanded="True">
<Event Name="SoundOutHeadset" />
<Action>
System.Execute(u'rundll32.exe', u'shell32.dll,Control_RunDLL mmsys.cpl,,0', 0, False, 2, u'')
</Action>
<Action>
EventGhost.ShowOSD(u'Headset', u'0;-48;0;0;0;700;0;0;0;0;3;2;1;34;Arial', (255, 255, 255), (0, 0, 0), 4, (0, 0), 0, 4.0, True)
</Action>
<Action>
EventGhost.Wait(0.10000000000000001)
</Action>
<Action>
Window.FindWindow(u'rundll32.exe', u'Sound', u'#32770', u'', u'SysListView32', 1, False, 8.0, 0)
</Action>
<Action>
Window.SendKeys(u'{Down}', False)
</Action>
<Action>
EventGhost.Wait(0.10000000000000001)
</Action>
<Action>
Window.SendKeys(u'{Tabulator}{Tabulator}{Return}{Escape}', False)
</Action>
<Action>
Window.FindWindow(u'rundll32.exe', u'Sound', u'#32770', u'', u'SysListView32', 1, False, 0.10000000000000001, 0)
</Action>
<Action>
Window.SendKeys(u'{Escape}', False)
</Action>
</Macro>
</EventGhost>Note that I am using 1 down to select the first audio device, by using two or more downs you get the other devices...
if you want to use the vbscript you can execute it from eventGhost as you would any other file by creating an action going to "system" and choosing "start application", and then entering the path and filename or using the browse button.
Last edited by jitterjames on Thu Mar 18, 2010 9:42 pm, edited 2 times in total.
- jitterjames
- Experienced User
- Posts: 677
- Joined: Thu Aug 13, 2009 4:36 pm
- Location: Quebec, Canada
- Contact:
Re: Change 'Playback Devices' in Control Panel (Sound)
now if I can just find a way to retask my realtek outputs so that I can switch them between headphone out and rear speaker out!
Re: Change 'Playback Devices' in Control Panel (Sound)
jitterjames
Thank you for your code, I modified mine to include your code and it works perfect.
I did leave the old vb script in there and attached a zip containing those if anyone wanted them.
I have included my EventGhost xml file for anyone to see how I am using the sound changing routine and folder usage.
Scat
Thank you for your code, I modified mine to include your code and it works perfect.
I did leave the old vb script in there and attached a zip containing those if anyone wanted them.
I have included my EventGhost xml file for anyone to see how I am using the sound changing routine and folder usage.
Scat
- Attachments
-
- vbscripts.zip
- VB scripts for changing outputs from pc speakers to the digital SPIDF and back again.
- (1.04 KiB) Downloaded 247 times
-
- my media computer-2.zip
- includes sections for SageTV, PowerDVD, Hulu, Media Player Classic HC,TotalMedia Theatre 3, and the changing of sound output from pc speakers to digital SPDIF
- (9.81 KiB) Downloaded 253 times
Re: Change 'Playback Devices' in Control Panel (Sound)
Have you tried Vista Audio Changer? Supposed to work on Win7 as it is the same sound subsystem.
http://www.raymond.cc/blog/archives/200 ... ta-and-xp/
http://www.raymond.cc/blog/archives/200 ... ta-and-xp/
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
Re: Change 'Playback Devices' in Control Panel (Sound)
Livin
Thanks for your suggestion, I have looked at Vista Audio Changer but I didn't want another program running all the time that I would only use maybe once a day.
Scat
Thanks for your suggestion, I have looked at Vista Audio Changer but I didn't want another program running all the time that I would only use maybe once a day.
Scat
- jitterjames
- Experienced User
- Posts: 677
- Joined: Thu Aug 13, 2009 4:36 pm
- Location: Quebec, Canada
- Contact:
Re: Change 'Playback Devices' in Control Panel (Sound)
I think this version works slightly better (faster / more reliable), the final stage uses a mouse click instead of the keyboard...
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1194">
<Macro Name="output = headset">
<Action>
System.Execute(u'rundll32.exe', u'shell32.dll,Control_RunDLL mmsys.cpl,,0', 0, False, 2, u'')
</Action>
<Action>
EventGhost.ShowOSD(u'Headset', u'0;-48;0;0;0;700;0;0;0;0;3;2;1;34;Arial', (255, 255, 255), (0, 0, 0), 4, (0, 0), 0, 4.0, True)
</Action>
<Action>
EventGhost.Wait(0.10000000000000001)
</Action>
<Action>
Window.FindWindow(u'rundll32.exe', u'Sound', u'#32770', u'', u'SysListView32', 1, False, 8.0, 0)
</Action>
<Action>
Window.SendKeys(u'{Down}', False)
</Action>
<Action>
EventGhost.Wait(0.10000000000000001)
</Action>
<Action>
Window.FindWindow(u'rundll32.exe', u'Sound', u'#32770', u'&Set Default', u'Button', 1, False, 1.1000000000000001, 0)
</Action>
<Action>
Window.SendMessage(245, 0, 0, 0)
</Action>
<Action>
Window.SendKeys(u'{Escape}', False)
</Action>
</Macro>
</EventGhost>Re: Change 'Playback Devices' in Control Panel (Sound)
scat,
I'm with you. I'll try out the script... I could use audio switching for when I want to play XBMC thoughout the house.
If I could get multiple audio outputs are the same time that would be nice too... do you know a way?
I'm with you. I'll try out the script... I could use audio switching for when I want to play XBMC thoughout the house.
If I could get multiple audio outputs are the same time that would be nice too... do you know a way?
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
-
seth.feinberg
- Posts: 25
- Joined: Mon May 09, 2011 11:29 pm
Re: Change 'Playback Devices' in Control Panel (Sound)
I know this is old, but I thought I'd share what I found out/know (not much:)). I needed dual audio outputs because my Denon Receiver's Zone 2 only takes an Analog signal and I mostly need to use HDMI for the 5.1. After a WHOLE ton of frustration I realized that Windows 7 just flat out doesn't allow 2 audio outs (if you find out differently please let me know).
As far as a fix: I had to go into Sound under the Control panel and click on the Recording tab. There should be a Stereo Mix item (or maybe it's part of my card. either way for this to work you need to be able to record), right-click it, show properties and click on the Listen tab. Click on the "Listen to this Device" radio button and then select your HDMI Audio output from the dropdown list just below titled, "Playback through this Device" . This will have your soundcard (I think?) RECORD the sound your computer is sending out through the analog signal and then play it back through the HDMI. Then under the Playback tab of the Sound window, you'll have to make sure Speakers (your analog output) is set as the Default player and not the HDMI. Unfortunately this means only stereo (2channel) sound is outputted through the HDMI which is why I needed EventGhost, so I could create macros to switch back and forth from my Logitech remote so I can enjoy 5.1 99% of the time, but analog when I want to play music through my Zone 2.
In case you are curious these are my EventGhost's:
"Enable HDMI":
...and "Enable Analog":
On an unrelated note, I'm worried about such contingencies as me accidentally firing the "Enable HDMI" EventGhost when HDMI is already enabled or maybe when the Sound dialog box is already open. Does anybody have any tips/tricks for making these a bit more idiot proof?
As far as a fix: I had to go into Sound under the Control panel and click on the Recording tab. There should be a Stereo Mix item (or maybe it's part of my card. either way for this to work you need to be able to record), right-click it, show properties and click on the Listen tab. Click on the "Listen to this Device" radio button and then select your HDMI Audio output from the dropdown list just below titled, "Playback through this Device" . This will have your soundcard (I think?) RECORD the sound your computer is sending out through the analog signal and then play it back through the HDMI. Then under the Playback tab of the Sound window, you'll have to make sure Speakers (your analog output) is set as the Default player and not the HDMI. Unfortunately this means only stereo (2channel) sound is outputted through the HDMI which is why I needed EventGhost, so I could create macros to switch back and forth from my Logitech remote so I can enjoy 5.1 99% of the time, but analog when I want to play music through my Zone 2.
In case you are curious these are my EventGhost's:
"Enable HDMI":
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1494">
<Macro Name="Enable HDMI" Expanded="True">
<Event Name="Keyboard.LCtrl+LAlt+1" />
<Event Name="Keyboard.RCtrl+RAlt+1" />
<Action>
System.Execute(u'rundll32.exe', u'shell32.dll,Control_RunDLL mmsys.cpl,,0', 0, False, 2, u'')
</Action>
<Action>
EventGhost.ShowOSD(u'HDMI', u'0;-48;0;0;0;700;0;0;0;0;3;2;1;34;Arial', (255, 255, 255), (0, 0, 0), 4, (0, 0), 0, 4.0, True)
</Action>
<Action>
EventGhost.Wait(0.10000000000000001)
</Action>
<Action>
Window.FindWindow(u'rundll32.exe', u'Sound', u'#32770', u'', u'SysListView32', 1, False, 8.0, 0)
</Action>
<Action>
Window.SendKeys(u'{Down}', False)
</Action>
<Action>
EventGhost.Wait(0.10000000000000001)
</Action>
<Action>
Window.SendKeys(u'{Tabulator}{Tabulator}{Enter}', False)
</Action>
<Action>
EventGhost.Wait(0.10000000000000001)
</Action>
<Action>
Window.SendKeys(u'{Escape}', False)
</Action>
</Macro>
</EventGhost>Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1494">
<Macro Name="Enable Analog" Expanded="True">
<Event Name="Keyboard.LCtrl+LAlt+2" />
<Event Name="Keyboard.RCtrl+RAlt+2" />
<Action>
System.Execute(u'rundll32.exe', u'shell32.dll,Control_RunDLL mmsys.cpl,,0', 0, False, 2, u'')
</Action>
<Action>
EventGhost.ShowOSD(u'Analog', u'0;-48;0;0;0;700;0;0;0;0;3;2;1;34;Arial', (255, 255, 255), (0, 0, 0), 4, (0, 0), 0, 4.0, True)
</Action>
<Action>
EventGhost.Wait(0.10000000000000001)
</Action>
<Action>
Window.FindWindow(u'rundll32.exe', u'Sound', u'#32770', u'', u'SysListView32', 1, False, 8.0, 0)
</Action>
<Action>
Window.SendKeys(u'{Down}{Down}', False)
</Action>
<Action>
EventGhost.Wait(0.10000000000000001)
</Action>
<Action>
Window.SendKeys(u'{Tabulator}{Tabulator}{Enter}', False)
</Action>
<Action>
EventGhost.Wait(0.10000000000000001)
</Action>
<Action>
Window.SendKeys(u'{Escape}', False)
</Action>
</Macro>
</EventGhost>Re: Change 'Playback Devices' in Control Panel (Sound)
Anyone else looking for a solution to this, at least in windows 7, should check out: http://www.daveamenta.com/2011-05/progr ... windows-7/
Re: Change 'Playback Devices' in Control Panel (Sound)
Seth,
You solutions looks good/creative. I may need to use it if I start using my whole/house audio more.
I'm not sure how you have EG setup, but I suggest using "Activity" based macros. Examples: Watch Video Library, Watch DVD/BR, Watch DVR Recorded Shows, Watch Live TV, Listen to Music Library, Listen to Radio, Listen to CD, etc
... a single Activity holds all the needed changes (apps/hardware/OS/etc), thus you should be assured you never 'accidentally' enable/disable something you need. Just map each Activity to a single button on your remote.
You solutions looks good/creative. I may need to use it if I start using my whole/house audio more.
I'm not sure how you have EG setup, but I suggest using "Activity" based macros. Examples: Watch Video Library, Watch DVD/BR, Watch DVR Recorded Shows, Watch Live TV, Listen to Music Library, Listen to Radio, Listen to CD, etc
... a single Activity holds all the needed changes (apps/hardware/OS/etc), thus you should be assured you never 'accidentally' enable/disable something you need. Just map each Activity to a single button on your remote.
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
