Lautstärke regeln (war: Mit welcher Funktion)
-
kann ich das Windows Sound system ansteuern.
Sprich ich möchte mit einem Programm die Lautstärke regel und das mit Tastendruck, sprich ich habe zusatztasten am Keyboard. Und diese möchte ich nutzen um meinen Sound leiser oder lauter zu machen.
Wie muss ich das umsetzen?
gruss
Bassdrum[EDIT]
Bitte aussagekräftige Überschriften wählen. Danke!
[/EDIT]
-
-
DWORD vol;
vol=MAKELONG(volume Links,volume Rechts);
waveOutSetVolume((HWAVEOUT)0,vol);MMRESULT waveOutSetVolume(HWAVEOUT hwo, DWORD dwVolume);
Sets the volume level of the specified waveform-audio output device.
· Returns MMSYSERR_NOERROR if successful or an error otherwise. Possible error values include the following:
MMSYSERR_INVALHANDLE Specified device handle is invalid.
MMSYSERR_NODRIVER No device driver is present.
MMSYSERR_NOMEM Unable to allocate or lock memory.
MMSYSERR_NOTSUPPORTED Function is not supported.
hwoHandle of an open waveform-audio output device.
dwVolume
New volume setting. The low-order word contains the left-channel volume setting, and the high-order word contains 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.Changing the volume on a handle changes it for an instance of the device, rather than changing the default volume for the device (and affecting all instances of the device).
Not all devices support volume changes. To determine whether the device supports volume control, use the WAVECAPS_VOLUME flag to test the dwSupport member of the WAVEOUTCAPS structure (filled by the waveOutGetDevCaps function). To determine whether the device supports volume control on both the left and right channels, use the WAVECAPS_LRVOLUME flag.Most devices do not support the full 16 bits of volume-level control and will not use 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 all produce the same physical volume setting: 0x4000. The waveOutGetVolume function returns the full 16-bit setting set with waveOutSetVolume.
Volume settings are interpreted logarithmically. This means the perceived increase in volume is the same when increasing the volume level from 0x5000 to 0x6000 as it is from 0x4000 to 0x5000.