i am in problem...
I want my mp3player to use winamp dsp plugin.
so i added dspactivex ocx. i'm noobs..
this is my source...(stream procedure)
Procedure WinampDSPProc(handle: HSYNC; channel: DWORD; buffer: Pointer; length, user: DWORD); stdcall;
Var
d : ^Byte;
DecBuf : ^Byte;
c : DWord;
a : Integer;
excess2 : ^Byte;
begin
d:=Buffer;
c:=Length;
if (exlen>0) Then Begin // excess left from last time
If c>ExLen Then a:=ExLen Else a:=c;
End Else Begin
a:=exlen;
Move(d^,excess,a);
Dec(exlen,a);
Excess2:=@Excess;
Inc(Excess2,a);
if (exlen>0) Then Move(excess^,Excess2^,exlen); // some excess remaining
Inc(d,a); // advance buffer
c:=c-a;
End;
while (c>0) Do Begin
a:=BASS_ChannelGetData(Channel, decbuf, decblock);
if (a<0) Then break; // end of data (you may want to continue processing for effect tail)
a:=4*DspOcx.ModifySamples(Integer(@decbuf),a div 4,16,2,44100);
Beep;
if (a>c) Then Begin // some excess data, keep it for next time
Move(d^,decbuf^,c);
exlen:=a-c;
Inc(Decbuf,c);
Move(excess^,decbuf^,exlen);
c:=0; // all done
End else Begin
Move(d^,decbuf^,a);
Inc(d,a); // advance buffer
c:=c-a;
End;
End;
Buffer:=@DecBuf;
End;
i translated c++ source code..
it does not work.
but only access violation..
please help me !!!!!!!!!!
sorry for my bad English... i'm not native speaker.