OK, let's try this again: Is there a way to mute or unmute a computer's sound card through scripting?
Announcement
Collapse
No announcement yet.
SCRIPTING NOVICE: Mute/Unmute (Take 2)
Collapse
X
-
Try what again? There are no built-in HS scripting commands to do so, but those functions should be accessible by .NET. A Google search found a few ways, but seems to be hit and miss. One option may be the NAudio library: https://github.com/naudio/NAudio. It has way more functionality, than just muting/unmuting but I believe it does have functions for that.HS 4.2.8.0: 2134 Devices 1252 Events
Z-Wave 3.0.10.0: 133 Nodes on one Z-Net
-
(Sigh) I guess nothing can be easy.
Try what again?
Jim Speiser
38-year veteran of Home Automation
Still don't know squat
Comment
-
Originally posted by JimSpy View Post(Sigh) I guess nothing can be easy.
I had posted a much longer message under a similar title, but got no responses. I figure it was too complicated, so I tried simplifying, and got you! (No inferences to be drawn!)
The other option (and likely much simpler) is to use this utility: https://www.nirsoft.net/utils/nircmd.html. You can run external programs through events or scripts. Run it manually first to see if it works on your system.HS 4.2.8.0: 2134 Devices 1252 Events
Z-Wave 3.0.10.0: 133 Nodes on one Z-Net
Comment
-
There's also this one: https://www.nirsoft.net/utils/sound_volume_view.html. It has a GUI, but also a command line interface.HS 4.2.8.0: 2134 Devices 1252 Events
Z-Wave 3.0.10.0: 133 Nodes on one Z-Net
Comment
-
Originally posted by sparkman View PostThere's also this one: https://www.nirsoft.net/utils/sound_volume_view.html. It has a GUI, but also a command line interface.
Function Launch(byVal "C:\Users\Speiser's\Desktop\soundvolumeview\SoundVolumeV iew" As String, byVal "/mute" As String, byVal "" As String, byVal 0 As Integer) As Integer
...but of course that doesn't work.
Jim Speiser
38-year veteran of Home Automation
Still don't know squat
Comment
-
Originally posted by JimSpy View Post
OK, I finally got back around to this. That's going to work. Now, I just have to learn how to call it in a script. Do I use the "Launch" function? And if so, how do I set the parameters? I have it as...
Function Launch(byVal "C:\Users\Speiser's\Desktop\soundvolumeview\SoundVolumeV iew" As String, byVal "/mute" As String, byVal "" As String, byVal 0 As Integer) As Integer
...but of course that doesn't work.
The syntax should be:
Code:Dim x as Integer x = hs.Launch("C:\Users\Speiser's\Desktop\soundvolumeview\SoundVolumeView", "/mute", "" , 0)
HS 4.2.8.0: 2134 Devices 1252 Events
Z-Wave 3.0.10.0: 133 Nodes on one Z-Net
Comment
-
Originally posted by sparkman View Post
Yes, launch will work if you are using a script or you can trigger it direct in an event as well.
The syntax should be:
Code:Dim x as Integer x = hs.Launch("C:\Users\Speiser's\Desktop\soundvolumeview\SoundVolumeView", "/mute", "" , 0)
Thank you, I'll give it a try.
Jim Speiser
38-year veteran of Home Automation
Still don't know squat
Comment
-
Originally posted by JimSpy View Post
Well, that certainly makes it easier. The online Help file makes it look like it has to be in .vb format.
Thank you, I'll give it a try.
Cheers
AlHS 4.2.8.0: 2134 Devices 1252 Events
Z-Wave 3.0.10.0: 133 Nodes on one Z-Net
Comment
Comment