The GW-Scripting list is a discussion list for information regarding the development and use of Window-Eyes scripts. Any subscriber of the GW-Scripting list has the ability to post on-topic messages.

From:

 "Chip Orange" <lists3717@comcast.net>

Subject:

 RE: Changeing the default playback device in Windows 7

Date:

 Sun, Sep 29, 2013 9:04:25 pm
This is a multipart message in MIME format.

------=_NextPart_000_000D_01CEBD57.7AB54EB0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hi Rod,



Below are a few lines of VBScript which I found in an example, showing how
to use WMI to get a list of all soundcards on a pc (and one of the
properties it shows is the "id", which maybe is the same property which you
are passing on the commandline to your .exe).



Hth,



Chip

strComputer = "."

Set objWMIService = GetObject("winmgmts:" _

& "{impersonationLevel=impersonate}!\" & strComputer & "rootcimv2")



Set colItems = objWMIService.ExecQuery("Select * from Win32_SoundDevice")



For Each objItem in colItems

speak "Description: " & objItem.Description

speak "Device ID: " & objItem.DeviceID

speak "DMA Buffer Size: " & objItem.DMABufferSize

speak "Manufacturer: " & objItem.Manufacturer

speak "MPU 401 Address: " & objItem.MPU401Address

speak "Name: " & objItem.Name

speak "PNP Device ID: " & objItem.PNPDeviceID

speak "Product Name: " & objItem.ProductName

speak "Status Information: " & objItem.StatusInfo

Next



From: Rod Hutton [mailto:rhstuff@sympatico.ca]
Sent: Sunday, September 29, 2013 7:29 PM
To: gws >> gw-scripting
Subject: Changeing the default playback device in Windows 7



Hi everyone,




I found this page through google where you can download a zip archive
containing an executable as well as resources for Python and a Visual Studio
C# project for an app which changes the default sound device in Windows 7.
The executable works on my Windows 7 x64 system perfectly, and I figured it
would work fine in 32-bit Windows 7. I was hoping to integrate the
executable into a WE app, but I can do no more than specify a specific sound
device ID on the executable command line, like this:



Endpointcontroller.exe 0



Which would make the first sound device on the system the default. Indeed,
specifying no ID on the command line displays a list of all the playback
devices, but I tried every DOS trick I know to try to store this list to a
text file in order to be able to work with it, to no avail. Of course, I
could make an app which just cycles through, say, 5 IDs, just to try to
cover as many situations as possible, but this is kind of a cheezy approach.
Anyway, if you have time an interest, check it out and see what you think.



Here's the URL:



http://tomchuk.com/post/changing-the-default-playback-device-on-windows-7-wi
th-less-clicking-4



Cheeres,



Rod




------=_NextPart_000_000D_01CEBD57.7AB54EB0
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"; xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin-top:0in;
margin-right:0in;
margin-bottom:10.0pt;
margin-left:0in;
line-height:115%;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
..MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>Hi Rod,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Below are a few lines of VBScript which I found in an example, showing how to use WMI to get a list of all soundcards on a pc (and one of the properties it shows is the &#8220;id&#8221;, which maybe is the same property which you are passing on the commandline to your .exe).<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Hth,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><div style='mso-element:para-border-div;border:none;border-bottom:solid windowtext 1.0pt;padding:0in 0in 1.0pt 0in'><p class=MsoNormal style='border:none;padding:0in'><span style='color:#1F497D'>Chip<o:p></o:p></span></p></div><p class=MsoNormal><span style='color:#1F497D'>strComputer = &quot;.&quot;<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Set objWMIService = GetObject(&quot;winmgmts:&quot; _<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp;&nbsp; &amp; &quot;{impersonationLevel=impersonate}!\&quot; &amp; strComputer &amp; &quot;rootcimv2&quot;)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Set colItems = objWMIService.ExecQuery(&quot;Select * from Win32_SoundDevice&quot;)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>For Each objItem in colItems<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp;&nbsp; speak&nbsp; &quot;Description: &quot; &amp; objItem.Description<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp;&nbsp; speak&nbsp; &quot;Device ID: &quot; &amp; objItem.DeviceID<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp;&nbsp; speak&nbsp; &quot;DMA Buffer Size: &quot; &amp; objItem.DMABufferSize<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp;&nbsp; speak&nbsp; &quot;Manufacturer: &quot; &amp; objItem.Manufacturer<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp;&nbsp; speak&nbsp; &quot;MPU 401 Address: &quot; &amp; objItem.MPU401Address<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp;&nbsp; speak&nbsp; &quot;Name: &quot; &amp; objItem.Name<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp;&nbsp; speak&nbsp; &quot;PNP Device ID: &quot; &amp; objItem.PNPDeviceID<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp;&nbsp; speak&nbsp; &quot;Product Name: &quot; &amp; objItem.ProductName<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>&nbsp;&nbsp;&nbsp; speak&nbsp; &quot;Status Information: &quot; &amp; objItem.StatusInfo<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Next<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='margin-bottom:0in;margin-bottom:.0001pt;line-height:normal'><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> Rod Hutton [mailto:rhstuff@sympatico.ca] <br><b>Sent:</b> Sunday, September 29, 2013 7:29 PM<br><b>To:</b> gws &gt;&gt; gw-scripting<br><b>Subject:</b> Changeing the default playback device in Windows 7<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Hi everyone,<br><br><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><br>I found this page through google where you can download a zip archive containing an executable as well as resources for Python and a Visual Studio C# project for an app which changes the default sound device in Windows 7.&nbsp; The executable works on my Windows 7 x64 system perfectly, and I figured it would work fine in 32-bit Windows 7.&nbsp; I was hoping to integrate the executable into a WE app, but I can do no more than specify a specific sound device ID on the executable command line, like this:<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Endpointcontroller.exe 0<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Which would make the first sound device on the system the default.&nbsp; Indeed, specifying no ID on the command line displays a list of all the playback devices, but I tried every DOS trick I know to try to store this list to a text file in order to be able to work with it, to no avail.&nbsp; Of course, I could make an app which just cycles through, say, 5 IDs, just to try to cover as many situations as possible, but this is kind of a cheezy approach.&nbsp; Anyway, if you have time an interest, check it out and see what you think.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Here&#8217;s the URL:<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><a href="http://tomchuk.com/post/changing-the-default-playback-device-on-windows-7-with-less-clicking-4">http://tomchuk.com/post/changing-the-default-playback-device-on-windows-7-with-less-clicking-4</a><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Cheeres,<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Rod<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p></div></body></html>
------=_NextPart_000_000D_01CEBD57.7AB54EB0--