MMControl播放CD怎样改变音量?请高手指点!!

来源:百度知道 编辑:UC知道 时间:2024/06/04 14:34:04
用VB的MMcontrol控件制作CD播放器,在MMControl.Command=""中写什么命令才能改变当前声音的音量??
还有在录音的时候怎样改变输入源?怎样录声卡中的所有声音??

mmc直接好像不行,用API吧

Private Declare Function waveOutSetVolume Lib "Winmm" (ByVal wDeviceID As Integer, ByVal dwVolume As Long) As Integer
Private Declare Function waveOutGetVolume Lib "Winmm" (ByVal wDeviceID As Integer, dwVolume As Long) As Integer
Private Sub Command1_Click()
Dim a, i As Long
Dim tmp As String
a = waveOutGetVolume(0, i)
tmp = "&h" & Right(Hex$(i), 4)
Text1 = CLng(tmp)
End Sub
Private Sub Command2_Click()
Dim a, i As Long
Dim tmp, vol As String
vol = Text1
tmp = Right((Hex$(vol + 65536)), 4)
vol = CLng("&H" & tmp & tmp)
a = waveOutSetVolume(0, vol)
End Sub