ok...I made a sample from my big project!!!!

In one form there is one user control called Caster and in that the code is this:Private rchan As Long
Private encoder As Long
Sub sendD(buffer() As Byte)
On Error GoTo handler
Winsock.SendData buffer()
Exit Sub
handler:
Debug.Print Err.Number & vbCrLf & Err.Description
BASS_Encode_Stop (rchan)
End Sub
Private Sub Command1_Click()
BASS_RecordInit -1
BASS_RecordSetDevice 0
rchan = BASS_RecordStart(44100, 2, BASS_RECORD_PAUSE, AddressOf RecordingCallback, 0)
BASS_ChannelPlay rchan, True
encoder = BASS_Encode_Start(rchan, "lame --alt-preset standard - -", 0, AddressOf ENCODEPROC, 0) ' start the encoder
If encoder = 0 Then
Call BASS_StreamFree(rchan)
Call BASS_Encode_Stop(rchan)
End If
End Sub
Private Sub Winsock_Close()
If Winsock.State <> sckClosed Then
Winsock.close
End If
End Sub
Private Sub Winsock_ConnectionRequest(ByVal requestID As Long)
If Winsock.State <> sckClosed Then Winsock.close
Winsock.accept requestID
Winsock.SendData "CONNECTED"
End Sub
Private Sub UserControl_Initialize()
Winsock.LocalPort = "8000"
If Winsock.State = sckClosed Then
Winsock.Listen
End If
End Sub
In module BassEnc:Sub ENCODEPROC(ByVal handle As Long, ByVal channel As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long)
Dim dati() As Byte
ReDim dati(length) As Byte
CopyMemory dati(0), buffer, length - 1
form.Caster.sendD dati()
End Sub
in another modulePublic Function RecordingCallback(ByVal handle As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long) As Long
RecordingCallback = BASS_Encode_IsActive(handle) ' continue recording if encoder is alive
End Function
This is all.....I believe!
Check this, and good luck!
Bye!