Mute Windows Volume

  • Thread starter Thread starter mbox204
  • Start date Start date
M

mbox204

Hello,

Need to know how to turn windows volume off or mute from within a form via
checkbox selection. Anyone have any experience or guidence to a link for
that
capability.

Thanks for your assistance.
Using Access 2000
 
To stop the currently played WAV file being played, just call
sndPlaySound with 0 and NULL parameters.

Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" ( _
ByVal lpszName As String, _
ByVal hModule As Long, _
ByVal dwFlags As Long) As Long

PlaySound("", 0, SND_PURGE Or SND_NODEFAULT) ' stop playback


Use waveOutGetVolume and waveOutSetVolume to control the speaker
volume.
Check out Q118377 in MSDN for a code
 
Do you mean, to turn the speaker off, or to stop the playback of the current
file? If the latter, is it a MIDI file or something else (eg. WAV)?

Search the web for the PlaySound windows API function. Maybe that will do
what you want.

HTH,
TC
 
---------------------------------------
Oops, did not mean to send this!
Please ignore & read my other reply.
 
Actually looking to have the ability to turn off the speaker. Using the
checkbox on the form, false value for checkbox will cause speaker to be on,
true value will cause speaker to be turned off
 
Hmm, not so simple to find!

This is all from other respondents, so I can not vouch for it personally.

* To mute the modem speaker, send the following command string to the
modem::
ATM0L0

* To turn the "warning beeper" on or off:
UNTESTED:
private Declare Function SystemParametersInfo Lib "User" ( _
ByVal uAction As Integer, _
ByVal uparam As Integer, _
lpvParam As Any, _
ByVal fuWinIni As Integer) As Integer
const SPI_SETBEEP = 2
const BEEP_ON = 1
const BEEP_OFF = 0
....
SystemParametersInfo SPI_SETBEEP, BEEP_OFF, vbNull, 0 ' or BEEP_ON

* To turn the >speaker< on or off:
Sorry, I have not been able to find this! Maybe someone else can help.

HTH,
TC
 
Back
Top