| 作者 | 主题 |
|---|---|
|
毕业设计123123 游民 经验值:61 发帖数:20 精华帖:0 |
楼主
主题:wincc 能不能采集音频数据
wincc能不能采集系统的音频数据,比较说音量
|
|
有谁共鸣 侠圣 经验值:3112 发帖数:2153 精华帖:21 |
楼
主题:回复:wincc 能不能采集音频数据
你到底要做什么都没说得清楚呢?采集什么?
VB代码: Private hmem As Long Const MMSYSERR_NOERROR = 0 Const MAXPNAMELEN = 32 Const MIXER_LONG_NAME_CHARS = 64 Const MIXER_SHORT_NAME_CHARS = 16 Const MIXER_GETLINEINFOF_COMPONENTTYPE = &H3& Const MIXER_GETCONTROLDETAILSF_VALUE = &H0& Const MIXER_SETCONTROLDETAILSF_VALUE = &H0& Const MIXER_GETLINECONTROLSF_ONEBYTYPE = &H2& Const MIXERLINE_COMPONENTTYPE_DST_FIRST = &H0& Const MIXERLINE_COMPONENTTYPE_SRC_FIRST = &H1000& Const MIXERLINE_COMPONENTTYPE_DST_SPEAKERS = _ (MIXERLINE_COMPONENTTYPE_DST_FIRST + 4) Const MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE = _ (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 3) Const MIXERLINE_COMPONENTTYPE_SRC_LINE = _ (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 2) Const MIXERCONTROL_CT_CLASS_FADER = &H50000000 Const MIXERCONTROL_CT_UNITS_UNSIGNED = &H30000 Const MIXERCONTROL_CONTROLTYPE_FADER = _ (MIXERCONTROL_CT_CLASS_FADER Or _ MIXERCONTROL_CT_UNITS_UNSIGNED) Const MIXERCONTROL_CONTROLTYPE_VOLUME = _ (MIXERCONTROL_CONTROLTYPE_FADER + 1) Private Type MIXERCONTROLDETAILS cbStruct As Long dwControlID As Long cChannels As Long item As Long cbDetails As Long paDetails As Long End Type Private Type MIXERCONTROLDETAILS_UNSIGNED dwValue As Long End Type Private Type MIXERCONTROL cbStruct As Long dwControlID As Long dwControlType As Long fdwControl As Long cMultipleItems As Long szShortName As String * MIXER_SHORT_NAME_CHARS szName As String * MIXER_LONG_NAME_CHARS lMinimum As Long lMaximum As Long reserved(10) As Long End Type Private Type MIXERLINECONTROLS cbStruct As Long dwLineID As Long dwControl As Long cControls As Long cbmxctrl As Long pamxctrl As Long End Type Private Type MIXERLINE cbStruct As Long dwDestination As Long dwSource As Long dwLineID As Long fdwLine As Long dwUser As Long dwComponentType As Long cChannels As Long cConnections As Long cControls As Long szShortName As String * MIXER_SHORT_NAME_CHARS szName As String * MIXER_LONG_NAME_CHARS dwType As Long dwDeviceID As Long wMid As Integer wPid As Integer vDriverVersion As Long szPname As String * MAXPNAMELEN End Type ' 'Allocates the specified number of bytes from the heap. Private Declare Function GlobalAlloc Lib "kernel32" (ByVal wFlags As Long, _ ByVal dwBytes As Long) As Long ' 'Locks a global memory object and returns a pointer to the ' first byte of the object's memory block. The memory block ' associated with a locked object cannot be moved or discarded. Private Declare Function GlobalLock Lib "kernel32" (ByVal hmem As Long) As Long ' 'Frees the specified global memory object and invalidates its handle. Private Declare Function GlobalFree Lib "kernel32" (ByVal hmem As Long) As Long ' Private Declare Sub CopyPtrFromStruct Lib "kernel32" Alias "RtlMoveMemory" _ (ByVal ptr As Long, struct As Any, ByVal cb As Long) Private Declare Sub CopyStructFromPtr Lib "kernel32" Alias "RtlMoveMemory" _ (struct As Any, ByVal ptr As Long, ByVal cb As Long) ' 'Opens a specified mixer device and ensures that the device ' will not be removed until the application closes the handle. Private Declare Function mixerOpen Lib "winmm.dll" _ (phmx As Long, ByVal uMxId As Long, ByVal dwCallback As Long, _ ByVal dwInstance As Long, ByVal fdwOpen As Long) As Long ' 'Sets properties of a single control associated with an audio line. Private Declare Function mixerSetControlDetails Lib "winmm.dll" _ (ByVal hmxobj As Long, pmxcd As MIXERCONTROLDETAILS, _ ByVal fdwDetails As Long) As Long ' 'Retrieves information about a specific line of a mixer device. Private Declare Function mixerGetLineInfo Lib "winmm.dll" _ Alias "mixerGetLineInfoA" (ByVal hmxobj As Long, _ pmxl As MIXERLINE, ByVal fdwInfo As Long) As Long ' 'Retrieves one or more controls associated with an audio line. Private Declare Function mixerGetLineControls Lib "winmm.dll" _ Alias "mixerGetLineControlsA" (ByVal hmxobj As Long, _ pmxlc As MIXERLINECONTROLS, ByVal fdwControls As Long) As Long Private hmixer As Long Private volCtrl As MIXERCONTROL ' Waveout volume control. Private micCtrl As MIXERCONTROL ' Microphone volume control. ' 'Local variable to save properties Private mvarprMicVolume As Long 'Local copy Private mvarprMicMaxVolume As Long 'Local copy Private mvarprMicMinVolume As Long 'Local copy Private mvarprSpeakerVolume As Long 'Local copy Private mvarprSpeakerMaxVolume As Long 'Local copy Private mvarprSpeakerMinVolume As Long 'Local copy Private mvarprMixerErr As Long 'Local copy
雄关漫道真如铁,而今迈步从头越!
|