none
controlling record devices in Windows

    Question

  • I've played with the command line utility NIRCMD.EXE and found it very effective at manipulating level and mute controls that appear under the "playback devices" tab of the sound window of Windows 7.  BUT I need to find a way to manipulate the controls found under the "record devices" tab.  Can this be done with Power Shell, or is there some other command line utility that I've overlooked that will give me access to these particular handles?  I'm working with a virtual sound card driver that provides four inputs and four outputs for AES67 IP audio.  In Windows 7 the driver places the level and mute controls for the four inputs under the "record devices" tab where I am thus far unable to access them via command line.  Any suggestions would be appreciated.

    Tuesday, January 8, 2019 4:45 PM

Answers

  • Well, eventually I found a solution.  I had been attempting to do this with NIRCMD.EXE's "setsubunitvolumedb" option, which supposedly allows the user to specify a sound device and a specific control listed under that sound device.  But I could only get that option to work with sound devices that were listed under the "playback devices" tab in Windows 7.  It wouldn't work when I specified a device under the "record devices" tab.  Eventually I turned my attention to NIRCMD.EXE's "setvolume" option, which can target the DEFAULT record device.  That in conjunction with NIRCMD.EXE's "setdefaultsounddevice" option allowed me to manipulate the record level of any device I chose.  For example, to set the record level of "Livewire In 01" device to 50%, I'd run these two commands:

    nircmd.exe setdefaultsounddevice "Livewire In 01" 0

    nircmd.exe setvolume 1 33333 33333

    So, using PowerShell and my specific set-up, here's how I set the record level of "Livewire In 03" to maximum:

    Start-Process -FilePath "S:\StudioPA\nircmd.exe" -ArgumentList 'setdefaultsounddevice "Livewire In 03" 0' -Wait
    Start-Process -FilePath "S:\StudioPA\nircmd.exe" -ArgumentList 'setvolume 1 65535 65535' -Wait

    This works beautifully under Windows 7...and works adequately under Windows 10.  I hope this information proves useful to someone.


    • Marked as answer by Chalk-X CPG Friday, January 11, 2019 5:36 PM
    • Edited by Chalk-X CPG Friday, January 11, 2019 7:35 PM
    Friday, January 11, 2019 5:35 PM

All replies

  • It is likely that this is possible only by using the correct calls from the Win32 API.

    Determining the precise calls needed, and a way to call them properly from a script, is not trivial (and also outside the scope of this forum).


    -- Bill Stewart [Bill_Stewart]

    Tuesday, January 8, 2019 5:54 PM
    Moderator
  • Well, eventually I found a solution.  I had been attempting to do this with NIRCMD.EXE's "setsubunitvolumedb" option, which supposedly allows the user to specify a sound device and a specific control listed under that sound device.  But I could only get that option to work with sound devices that were listed under the "playback devices" tab in Windows 7.  It wouldn't work when I specified a device under the "record devices" tab.  Eventually I turned my attention to NIRCMD.EXE's "setvolume" option, which can target the DEFAULT record device.  That in conjunction with NIRCMD.EXE's "setdefaultsounddevice" option allowed me to manipulate the record level of any device I chose.  For example, to set the record level of "Livewire In 01" device to 50%, I'd run these two commands:

    nircmd.exe setdefaultsounddevice "Livewire In 01" 0

    nircmd.exe setvolume 1 33333 33333

    So, using PowerShell and my specific set-up, here's how I set the record level of "Livewire In 03" to maximum:

    Start-Process -FilePath "S:\StudioPA\nircmd.exe" -ArgumentList 'setdefaultsounddevice "Livewire In 03" 0' -Wait
    Start-Process -FilePath "S:\StudioPA\nircmd.exe" -ArgumentList 'setvolume 1 65535 65535' -Wait

    This works beautifully under Windows 7...and works adequately under Windows 10.  I hope this information proves useful to someone.


    • Marked as answer by Chalk-X CPG Friday, January 11, 2019 5:36 PM
    • Edited by Chalk-X CPG Friday, January 11, 2019 7:35 PM
    Friday, January 11, 2019 5:35 PM