OK Chris. I think now you understood my problem. My code source this below. Will it be that you can help myself?
Public m_hStreamA(2) As Long
Public m_hPlayHandleA(2) As Long
Public Const decblock = 4608
Public excess(decblock * 2) As Byte
Public exlen As Long
Public freq As Long
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef Destination As Any, ByRef Source As Any, ByVal length As Long)
Public Function STREAMPROC(ByVal Channel As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long) As Long
On Error Resume Next
Dim decbuff(decblock * 2) As Byte
Dim tempbuffer() As Byte
ReDim tempbuffer(length) As Byte
Dim a As Long
Dim c As Long
Dim nBufferPos As Long
nBufferPos = 0
c = length
If exlen Then
a = 0
If (c < exlen) Then
a = c
Else
a = exlen
End If
Call CopyMemory(tempbuffer(nBufferPos), excess(0), a)
exlen = exlen - a
Call CopyMemory(excess(0), excess(a), exlen)
nBufferPos = nBufferPos + a
c = c - a
End If
Do While (c)
a = BASS_ChannelGetData(m_hStreamA(1), decbuff(0), decblock)
If a < 0 Then Exit Do
If frmMain.StartedA Then
a = 4 * frmMain.DSP.ModifySamples(VarPtr(decbuff(0)), a / 4, 16, 2, 44100)
End If
If (a > c) Then
Call CopyMemory(tempbuffer(nBufferPos), decbuff(0), c)
exlen = a - c
Call CopyMemory(excess(0), decbuff(c), exlen)
c = 0
Else
Call CopyMemory(tempbuffer(nBufferPos), decbuff(0), a)
nBufferPos = nBufferPos + a
c = c - a
End If
Loop
Call CopyMemory(ByVal buffer, tempbuffer(0), length - c)
STREAMPROC = length - c
End Function