I need to control the volume for both the CD and wave devices independantly. I know that they rewrote the entire sound system in Vista, but all the calls look like they are working when you examine the results under a debugger.Īnyhow, has nyone been able to get this to go under Vista? If not, I would be interested in what code libraries people are using under vista to control volume. I have recently become aware that the volume control doesn't set the volume when running under Window Vista. I have been using this library under XP for years with great success. That's why, as I think, the proposed classes might be of some help to you. However, working with a mixer just to add a pretty simple functionality is quite boring. The proposed classes do not encapsulate all the abilities exposed by the mixers. So don't rush to create lots of CVolumeInXXX objects, better share the only one through your code. MIXERLINE* pLineInfo, DWORD dwUserValue )īe aware, that for performance reasons it is better to have a single instance of a given class per application. Go on and use pMicrophoneVolume to manipulate the volume If ( !pMicrophoneVolume || !pMicrophoneVolume->IsAvailable() ) (IVolume*) new CVolumeInXXX( uMicrophoneLineIndex ) Error: mic volume'ing is not available. If ( !CVolumeInXXX::EnumerateInputLines( EnumInputLineProc, MIXERLINE* pLineInfo, DWORD dwUserValue ) void SetCurrentVolume( DWORD dwValue ) - Sets the volume.Īnd the last function allows to register a user-implemented callback that will be called as a notification of volume changes:īool CALLBACK EnumInputLineProc( UINT uLineIndex,.DWORD GetCurrentVolume() - Retrieves the current volume.DWORD GetMaximalVolume() - Retrieves the maximal volume that can be set.DWORD GetMinimalVolume() - Retrieves the minimal volume that can be set.DWORD GetVolumeMetric() - Retrieves the granularity of volume.void Disable() - Disables the line of the volume control.void Enable() - Enables the line of the volume control.bool IsAvailable() - Says whether the volume controlling is possible.Here I provide such classes that share a common interface (defined in IVolume.h): To make the volume-enabled application development easier, I decided to create a few C++ classes that would allow me to easily regulate and track the changes of such volume controls as Output Master Volume, WaveOut Volume and Input (WaveIn) Volume. Many times my applications required audio volume manipulation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |