Control left and right channels

xiaoxiao2021-03-06  56

'Code by 魑 魑 魍魉' Mailto: DemonStudio@hotmail.com

Private Declare Function waveOutGetVolume Lib "winmm.dll" (ByVal uDeviceID As Long, lpdwVolume As Long) As LongPrivate Declare Function waveOutSetVolume Lib "winmm.dll" (ByVal uDeviceID As Long, ByVal dwVolume As Long) As LongConst WAVE_MAPPER = -1 &

Public Function Setlr (Byval L As Long) AS Longdim Mlr As Stringmlr = "& H" & Right ("0000" & HEX (L), 4) & Right (0000 "& HEX (R), 4 WaveoutSetvolume Wave_mapper, ClNG (MLR) end function

Public Function Getlr (Byref L As Long, BYREF R As LongwaveoutgetVolume Wave_Mapper, LRL = ClNG ("& H" & Left (HEX (LR), 4)) R = CLNG ("& H" & Right (HEX (Lr), 4)) End function

The above two custom functions can be easily achieved and set to the left and right channels.

Such as:

Private Sub Form_Load () DIM ML AS Long, MR AS Longgetlr ML, MRMSGBOX "Left" & ML & "- Right" & MREND SUB

Private Sub Command1_Click () setlr 65535, 22222nd SUB

You can use a slider to perform meticulous control.

principle:

The volume value obtained by WaveOutgetvolume is converted to a 16-based, the high is the value of the left channel, the low position is the value of the right channel.

转载请注明原文地址:https://www.9cbs.com/read-115400.html

New Post(0)