05-18-2012 02:54 PM
Hi all,
Can somebody help me to figure out how I can mute and unmute different volume controls using winmm.dll. I have come across this post ( see below) that shows how to control individual volume controls but I am more interested how to mute or unmute these controls programmaticlly by calling winmm.dll. So specifically I am looking for something were I can send a Boolean true (mute ON) or false (mute OFF) that will to the task.
http://forums.ni.com/ni/board/message?board.id=170&message.id=22278&requireLogin=False
I have been looking under "Mixercontroldetail_Boolean" under http://msdn.microsoft.com/en-us/library/aa910066.aspx but I am having very difficult time to configure it properly so that it can do its task. I would really appreciate if somebody can help me on this because I am running out of ideas.
Thanks
05-21-2012 10:18 AM
nxb,
Have you considered using the waveOutSetVolume function inside winmm.dll, and writing '0' to mute the volume or '65535' to unmute the volume.
I have attached an example that achieves this functionality:
05-21-2012 12:06 PM
Hi jallen88
Thanks so much for responding back to me. This is an option that I was thinking before and unfortunately it does not satisfy my goal. Here is an explanation why it would not fit properly: If I would execute your code and at the same time open up volume control in windows, executing your code would not do anything to the mute check box in volume control it would only increase or decrease the slider on the actual volume but nothing would happen to the actual mute control. My goal is to be able to check on or to check off that Mute box in volume control using winmm.dll while running LabVIEW.
Please feel free to provide any further suggestions that would help me to resolve this problem.
Thank you
05-21-2012 12:08 PM
The solution I was going to post is not as elegant as a simple DLL call. In the past I've used NirCmd which is a commandline application.
http://www.nirsoft.net/utils/nircmd.html
It can do a bunch of other functions but if the DLL method works I would recommend using that.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
05-21-2012 03:10 PM
The link to the post is broken. Do you have the correct link?
I'm not sure what you mean about muting using winmm. There are no mute/unmute functions in the winmm DLL.
I'm also not sure what the page from MSDN that you linked to is supposed to show. That's just a datatype, not a function.
05-21-2012 04:05 PM - edited 05-21-2012 04:12 PM
After tinkering around with this, it seems the only way to do this with the Windows API is to use SendMessage. You can use it to send a message to the active window. Since LabVIEW won't handle the message, it will get passed up the chain, eventually reaching the shell. Note that there is no UNMUTE application command - to unmute just run the VI again. The operation acts like a toggle.
The attached example is in LabVIEW 8.2.
NOTE: I have no idea whether this will work under all versions of Windows.
06-20-2018 10:39 PM
Hi friends:
Thanks for your attach
And I have a QUESTION that how can I get the device ID.
Thanks and Regards
DK John
Primary Engineer
06-22-2018 09:15 AM
Hi,
You can use NI MAX to get the Device ID.