已经是DELPHI的代码了,BUILDER的俺还不会呢:)这是个API函数,Rtack,Ltack两个参数自己设置。函数原形如下: 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. dwVolumeNew 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.
Rtack表示右声道音量,Ltack表示左声道音量。
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. dwVolumeNew 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.