Mute the PC's Speakers

Started by Greg, January 18, 2005, 05:53:43 AM

Previous topic - Next topic

Greg

I needed a program that would mute the PC's speakers. I also wanted to learn how to use the Win32 Mixer API. So I wrote this program. I put a shortcut to it on my Desktop where I can quickly get at it. It can easily be modified to mute other devices such as CD, Line-In, Wave etc. I have other examples that set volume and tone levels, if anyone is interested I'll post them.

Greg

I was asked to post more of these Mixer API examples.

This one sets the volume of the speaker(s). It can be easily modified to set the volume for other devices, such as Wave, CD, Line-In etc.

Greg

This one sets the tone for the speaker(s). Again it can be easily modified for other devices.

laz

Thanks Greg!

I am trying to put this into a dll and keep getting errors on the api calls to the mmsystem. The errors i'm getting are:

POLINK: error: Unresolved external symbol '__imp__mixerOpen'.
POLINK: error: Unresolved external symbol '__imp__mixerGetLineInfoA'.
POLINK: error: Unresolved external symbol '__imp__mixerClose'.
POLINK: error: Unresolved external symbol '__imp__mixerGetLineControlsA'.
POLINK: error: Unresolved external symbol '__imp__mixerGetControlDetailsA'.
POLINK: error: Unresolved external symbol '__imp__mixerSetControlDetails'.
POLINK: fatal error: 6 unresolved external(s).


I have been trying to get this to work all day, but just can't seem to figure out why I'm getting these errors. Any ideas?

I had an idea. I added mmsystem.lib to the linker list and it works great!

Thank you for sharing!
~laz