台灣最大程式設計社群網站
線上人數
521
 
會員總數:246038
討論主題:189625
歡迎您免費加入會員
討論區列表 >> VB6 >> 請教 Mixer API的用法
[]  
[我要回覆]
回應主題 加入我的關注話題 檢舉此篇討論 將提問者加入個人黑名單
請教 Mixer API的用法
價值 : 10 QP  點閱數:3277 回應數:0
樓主

Larry
門外漢
0 1
6 0
發送站內信

各位高手
有沒有可以教我下列幾個FUNCTION的用法?
我其實只要找出LINE IN 然後讓程式可以設為靜音
我試了很久..也有SAMPLE 但是..不知道怎麼用

Declare Function mixerClose& Lib "winmm.dll" (ByVal hmx&)
Declare Function mixerGetControlDetails& Lib "winmm.dll" Alias "mixerGetControlDetailsA" (ByVal hmxobj&, pmxcd As MIXERCONTROLDETAILS, ByVal fdwDetails&)
Declare Function mixerGetDevCaps& Lib "winmm.dll" Alias "mixerGetDevCapsA" (ByVal uMxId&, pmxcaps As MIXERCAPS, ByVal cbmxcaps&)
Declare Function mixerGetID& Lib "winmm.dll" (ByVal hmxobj&, pumxID&, ByVal fdwId&)
Declare Function mixerGetLineControls& Lib "winmm.dll" Alias "mixerGetLineControlsA" (ByVal hmxobj&, pmxlc As MIXERLINECONTROLS, ByVal fdwControls&)
Declare Function mixerGetLineInfo& Lib "winmm.dll" Alias "mixerGetLineInfoA" (ByVal hmxobj&, pmxl As MIXERLINE, ByVal fdwInfo&)
Declare Function mixerGetNumDevs& Lib "winmm.dll" ()
Declare Function mixerMessage& Lib "winmm.dll" (ByVal hmx&, ByVal umsg&, ByVal dwParam1&, ByVal dwParam2&)
Declare Function mixerOpen& Lib "winmm.dll" (phmx&, ByVal uMxId&, ByVal dwCallback&, ByVal dwInstance&, ByVal fdwOpen&)
Declare Function mixerSetControlDetails& Lib "winmm.dll" (ByVal hmxobj&, pmxcd As MIXERCONTROLDETAILS, ByVal fdwDetails&)

Private Sub ChkMute_Click(Idx%)
'a mute-toggle has been clicked or actuated in some way
Dim hmem&
'save setting of the mute control which was clicked
MixerState(Idx).MxrMute = ChkMute(Idx).Value
'prepare the MCD struct
MCD.cbStruct = Len(MCD) 'overall struct size
MCD.dwControlID = MixerState(Idx).MxrMuteID 'control ID of the mute control which was clicked
MCD.cbDetails = 4 'four bytes, the size of a long
MCD.cChannels = ONE 'mute has but one channel
MCD.item = ZERO 'no items
'allocate a small amount of memory
hmem = GlobalAlloc(&H40, 4)
'consign the memory to MCD.paDetails
MCD.paDetails = GlobalLock(hmem)
'copy the value of the clicked mute to MCD.paDetails
CopyPtrFromStruct MCD.paDetails, MixerState(Idx).MxrMute, 4
'finalize the mute setting
mixerSetControlDetails hMixer, MCD, MIXER_SETCONTROLDETAILSF_VALUE
'tidy up memory
GlobalUnlock hmem
GlobalFree hmem
End Sub
</textarea>

搜尋相關Tags的文章: [ Mixer ] , [ 音效 ] ,
本篇文章發表於2008-03-31 13:23
目前尚無任何回覆
   

回覆
如要回應,請先登入.