Solved

SOUND MUTE, but HOW???

Posted on 2001-08-13
5
414 Views
Last Modified: 2013-11-20
I want to perform MUTE operation on sound through VC++. Can anyone HELP me in this issue.

Thanks!
0
Comment
Question by:lkjhgfdsa
  • 4
5 Comments
 

Author Comment

by:lkjhgfdsa
Comment Utility
Sorry but I don't want to USE MFC :-), is there any API solution for this???
0
 
LVL 4

Expert Comment

by:albay
Comment Utility
0
 
LVL 4

Expert Comment

by:albay
Comment Utility
0
 
LVL 4

Expert Comment

by:albay
Comment Utility
0
 
LVL 4

Accepted Solution

by:
albay earned 100 total points
Comment Utility
i am sorry. i tried to send a comment. but it failed.  i am trying again.

use  "auxSetVolume" function defined in MMSYSTEM.H

The auxSetVolume function sets the volume of the specified auxiliary output device.

MMRESULT auxSetVolume(
  UINT uDeviceID,
  DWORD dwVolume  
);

Parameters

uDeviceID
Identifier of the auxiliary output device to be queried. Device identifiers are determined implicitly from the number of devices present in the system. Device identifier values range from zero to one less than the number of devices present. Use the auxGetNumDevs function to determine the number of auxiliary devices in the system.
 
dwVolume
Specifies the new volume setting. The low-order word specifies the left-channel volume setting, and the high-order word specifies the right-channel setting. A value of 0xFFFF represents full volume, and a value of 0x0000 is silence.
If a device does not support both left and right volume control, the low-order word of dwVolume specifies the volume level, and the high-order word is ignored.

Return Values
Returns MMSYSERR_NOERROR if successful or an error otherwise. Possible error values include the following.

Value Description
MMSYSERR_BADDEVICEID Specified device identifier is out of range.


Remarks
Not all devices support volume control. To determine whether the device supports volume control, use the AUXCAPS_VOLUME flag to test the dwSupport member of the AUXCAPS structure (filled by the auxGetDevCaps function).

To determine whether the device supports volume control on both the left and right channels, use the AUXCAPS_LRVOLUME flag to test the dwSupport member of the AUXCAPS structure (filled by auxGetDevCaps).

Most devices do not support the full 16 bits of volume-level control and will use only the high-order bits of the requested volume setting. For example, for a device that supports 4 bits of volume control, requested volume level values of 0x4000, 0x4FFF, and 0x43BE will produce the same physical volume setting, 0x4000. The auxGetVolume function will return the full 16-bit setting set with auxSetVolume.

Volume settings are interpreted logarithmically. This means the perceived volume increase is the same when increasing the volume level from 0x5000 to 0x6000 as it is from 0x4000 to 0x5000.

good luck,
albay
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Powershell based monitoring system 2 127
Question regarding Copy/Paste 16 86
deburging in oracle form 12 76
matchUp  challenge 9 71
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now