InetSendSound2 Example for Visual Basic

' This example uses LEAD Capture control to capture audio from the microphone and send it to
' a remote computer. For an example of starting and stopping recording, refer to the LEAD Capture
' control documentation.

Private Sub StartRecord_Click()
   ' the capture doesn't have to be connected to use the following functions
   LEADCap1.CapAudioFormat(CAP_AUDIO_RECORD) = FILE_WAV_1M08
   ' open recording device
   LEADCap1.CapOpenRecord 0, 2, LEADCap1.CapWaveAvgBytesPerSec(CAP_AUDIO_RECORD)
   LEADCap1.CapStartRecord
End Sub


Private Sub LEADCap1_CapAudioData(ByVal pData As Variant, ByVal lBytesRecorded As Long, ByVal iIndex As Integer)
   ' send sound to remote computer (items in SendList property)
   ' you should be connected to a remote computer first by using the
   ' InetConnect method of the Internet COM
   LEADClient.InetSendSound2 LEADCap1.CapWaveFormatTag(CAP_AUDIO_RECORD), LEADCap1.CapWaveChannels(CAP_AUDIO_RECORD), _
   LEADCap1.CapWaveSamplesPerSec(CAP_AUDIO_RECORD), LEADCap1.CapWaveAvgBytesPerSec(CAP_AUDIO_RECORD), _
   LEADCap1.CapWaveBlockAlign(CAP_AUDIO_RECORD), LEADCap1.CapWaveBitsPerSample(CAP_AUDIO_RECORD), _
   LEADCap1.CapWaveExtraSize(CAP_AUDIO_RECORD), LEADCap1.CapWaveExtraData(CAP_AUDIO_RECORD), pData, lBytesRecorded
   DoEvents
End Sub