Private m_mixerId As Integer = 0
Private hmx As IntPtr
Const CALLBACK_WINDOW As Integer = &H10000
Const MIXER_OBJECTF_MIXER As Integer = &H0
Const MM_MIXM_CONTROL_CHANGE As Integer = &H3D1
<DllImport("winmm.dll")> _
Private Shared Function mixerOpen(ByRef phmx As IntPtr, <MarshalAs(UnmanagedType.U4)> ByVal uMxId As Integer, ByVal dwCallback As IntPtr, ByVal dwInstance As IntPtr, <MarshalAs(UnmanagedType.U4)> ByVal fdwOpen As Integer) As <MarshalAs(UnmanagedType.U4)> Integer
End Function
<DllImport("winmm.dll")> _
Private Shared Function mixerClose(ByVal hmx As IntPtr) As <MarshalAs(UnmanagedType.U4)> Integer
End Function
Public Function GetInputLevel() As Integer
Try
If hmx <> IntPtr.Zero Then
mixerClose(hmx)
End If
'If m_mixerId >= 0 Then
Dim result As Integer = mixerOpen(hmx, m_mixerId, Main.Handle, IntPtr.Zero, CALLBACK_WINDOW Or MIXER_OBJECTF_MIXER)
Return result
'End If
Catch ex As Exception
End Try
End Function