Hi Chip,

Thanks very much for the code snippit; I ran it, and it does enumerate my system audio devices, but it seems to lump the recording and playback devices together in this list, without any reference to which is which. I compared it to the list generated by endpointcontroller.exe, and the endpointcontroller listed a digital device which was not reported by the code you gave me. I dunno. I'm just not that savvy about audio objects; love to learn, though (smile). Also, the device IDs your code outputs are long, while endpointcontroller.exe just lists them, starting from 0, along with their names.

Much thanks,

Rod

Original message:
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 & "\root\cimv2")
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:[email protected]
]
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

Reply via email to