NO

Author Topic: Mute the PC's Speakers  (Read 6041 times)

Greg

  • Guest
Mute the PC's Speakers
« on: January 18, 2005, 05:53:43 AM »
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

  • Guest
Mute the PC's Speakers
« Reply #1 on: May 10, 2006, 10:05:07 PM »
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

  • Guest
Mute the PC's Speakers
« Reply #2 on: May 10, 2006, 10:08:19 PM »
This one sets the tone for the speaker(s). Again it can be easily modified for other devices.

laz

  • Guest
Mute the PC's Speakers
« Reply #3 on: May 11, 2006, 12:50:53 AM »
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