Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Windows Scripting to Control Audio Device
New Posts  All Forums:Forum Nav:

Windows Scripting to Control Audio Device

post #1 of 5
Thread Starter 
Does anyone know how to create a script for XP? I want something to switch between my speakers on X-Fi and my Logitech USB headset. Usually I have to open up the "Sound and Audio Devices Properties" and have to manually switch two audio and two voice settings.
Once again...
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 920 [4.28GHz, HT] Asus P6T + Broadcom NetXtreme II VisionTek HD5850 [900/1200] + Galaxy GT240 2x4GB G.Skill Ripjaw X [1632 MHz] 
Hard DriveOSMonitorKeyboard
Intel X25-M 160GB + 3xRAID0 500GB 7200.12 Window 7 Pro 64 Acer H243H + Samsung 226BW XARMOR-U9BL  
PowerCaseMouseMouse Pad
Antec Truepower New 750W Li Lian PC-V2100 [10x120mm fans] Logitech G9 X-Trac Pro 
  hide details  
Reply
Once again...
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 920 [4.28GHz, HT] Asus P6T + Broadcom NetXtreme II VisionTek HD5850 [900/1200] + Galaxy GT240 2x4GB G.Skill Ripjaw X [1632 MHz] 
Hard DriveOSMonitorKeyboard
Intel X25-M 160GB + 3xRAID0 500GB 7200.12 Window 7 Pro 64 Acer H243H + Samsung 226BW XARMOR-U9BL  
PowerCaseMouseMouse Pad
Antec Truepower New 750W Li Lian PC-V2100 [10x120mm fans] Logitech G9 X-Trac Pro 
  hide details  
Reply
post #2 of 5
This has a workable idea. I don't beleive the x-fi has an API that can be hooked into, so the following post shows how a vbs file can automate switching modes.

http://forums.creative.com/creativel...=174302#M54411


Digging a little deeper I found the following tool:
http://www.freewebs.com/spectra9/xfmc.html
Main Rig
(15 items)
 
  
Reply
Main Rig
(15 items)
 
  
Reply
post #3 of 5
Thread Starter 
Thanks for the reply BFRD, but this isn't what I am looking for. That is to change the X-Fi modes. I actually want to change my sound playback, sound recording, voice playback, and voice recording device. I need to switch between X-Fi to a USB headset. It shouldn't be at the application level, but at the OS level. Some registry key or something to set active device.
Once again...
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 920 [4.28GHz, HT] Asus P6T + Broadcom NetXtreme II VisionTek HD5850 [900/1200] + Galaxy GT240 2x4GB G.Skill Ripjaw X [1632 MHz] 
Hard DriveOSMonitorKeyboard
Intel X25-M 160GB + 3xRAID0 500GB 7200.12 Window 7 Pro 64 Acer H243H + Samsung 226BW XARMOR-U9BL  
PowerCaseMouseMouse Pad
Antec Truepower New 750W Li Lian PC-V2100 [10x120mm fans] Logitech G9 X-Trac Pro 
  hide details  
Reply
Once again...
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 920 [4.28GHz, HT] Asus P6T + Broadcom NetXtreme II VisionTek HD5850 [900/1200] + Galaxy GT240 2x4GB G.Skill Ripjaw X [1632 MHz] 
Hard DriveOSMonitorKeyboard
Intel X25-M 160GB + 3xRAID0 500GB 7200.12 Window 7 Pro 64 Acer H243H + Samsung 226BW XARMOR-U9BL  
PowerCaseMouseMouse Pad
Antec Truepower New 750W Li Lian PC-V2100 [10x120mm fans] Logitech G9 X-Trac Pro 
  hide details  
Reply
post #4 of 5
You should still be able to modify the vbs file to do just that. It basically is just a keystroke repeater. I seriously doubt the in-use operation of the device is handled in the registry. There is likely a "last-mode" or similar in there but usually those operations are only at startup (or control panel init).
Main Rig
(15 items)
 
  
Reply
Main Rig
(15 items)
 
  
Reply
post #5 of 5
Thread Starter 
Awesome, thanks for pointing me in the right direction. I found this script which returns sound device information. Good start. Rep+++

http://www.microsoft.com/technet/scr....mspx?mfr=true
Code:
On Error Resume Next

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\\\" & strComputer & "\
oot\\cimv2")

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

For Each objItem in colItems
    Wscript.Echo "Description: " & objItem.Description
    Wscript.Echo "Device ID: " & objItem.DeviceID
    Wscript.Echo "DMA Buffer Size: " & objItem.DMABufferSize
    Wscript.Echo "Manufacturer: " & objItem.Manufacturer
    Wscript.Echo "MPU 401 Address: " & objItem.MPU401Address
    Wscript.Echo "Name: " & objItem.Name
    Wscript.Echo "PNP Device ID: " & objItem.PNPDeviceID
    Wscript.Echo "Product Name: " & objItem.ProductName
    Wscript.Echo "Status Information: " & objItem.StatusInfo
Next
Once again...
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 920 [4.28GHz, HT] Asus P6T + Broadcom NetXtreme II VisionTek HD5850 [900/1200] + Galaxy GT240 2x4GB G.Skill Ripjaw X [1632 MHz] 
Hard DriveOSMonitorKeyboard
Intel X25-M 160GB + 3xRAID0 500GB 7200.12 Window 7 Pro 64 Acer H243H + Samsung 226BW XARMOR-U9BL  
PowerCaseMouseMouse Pad
Antec Truepower New 750W Li Lian PC-V2100 [10x120mm fans] Logitech G9 X-Trac Pro 
  hide details  
Reply
Once again...
(13 items)
 
  
CPUMotherboardGraphicsRAM
i7 920 [4.28GHz, HT] Asus P6T + Broadcom NetXtreme II VisionTek HD5850 [900/1200] + Galaxy GT240 2x4GB G.Skill Ripjaw X [1632 MHz] 
Hard DriveOSMonitorKeyboard
Intel X25-M 160GB + 3xRAID0 500GB 7200.12 Window 7 Pro 64 Acer H243H + Samsung 226BW XARMOR-U9BL  
PowerCaseMouseMouse Pad
Antec Truepower New 750W Li Lian PC-V2100 [10x120mm fans] Logitech G9 X-Trac Pro 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Windows Scripting to Control Audio Device