Hello there, I am back again. The codes are giving me a major headache. "Functions.bas" contains all the Audio API needed so I don't have to mess around with anything there. However in "Function.bas" there is a portion of codes that the programmer added himself:
I am at complete loss as to what those things mean. waveInGetID is needed to get the device identifier for the given waveform-audio input device and I have searched the rest at Microsoft's MSDN website. What I do not understand is how does the programmer knows what to add in since he said "Now my stuff".
' Now my stuff
Public Const CALLBACK_NULL = &H0
Public Const WHDR_DONE = 3
Public Const TIME_BYTES = 4
Public Const TIME_SAMPLES = 2
Public Declare Function waveInGetID Lib "winmm.dll" (lphWaveIn As Long, ByVal uDeviceID As Long) As Long
Declare Function waveInGetErrorText Lib "winmm.dll" Alias "waveInGetErrorTextA" (ByVal err As Long, ByVal lpText As String, ByVal uSize As Long) As Long
Declare Function waveInGetPosition Lib "winmm.dll" (ByVal hwi As Long, pmmt As MMTIME, ByVal cbmmt As Long) As Long
' Functions needed to allocate memory blocks
Declare Function HeapCreate Lib "kernel32" (ByVal flOptions As Long, ByVal dwInitialSize As Long, ByVal dwMaximumSize As Long) As Long
Declare Function HeapAlloc Lib "kernel32" (ByVal hHeap As Long, ByVal dwFlags As Long, ByVal dwBytes As Long) As Long
Declare Function HeapDestroy Lib "kernel32" (ByVal hHeap As Long) As Integer
wType As Integer
dwData As Long
dwData2 As Long ' Other data will not be used but there to
dwData3 As Long ' make the call think there's enough room
dwData4 As Long
Secondly, I am wondering where is the portion that changes the analogue ECG signal to digital? Or has the signal been digitised automatically by the soundcard and all he does is call the digital signal and then play with it ... if so which part of the code would that be?
The rest of the complete codes can be found here.