@IVan
thank you. i had find a equalizer source code, it work well in my PC, but too slowly to run in my wince device. i'm afraid that it's impossible to implement the equalizer quickly for me. is it possible to upgrade the directx to some new version to use BASS_ChannelSetFX correctly?
another problem, i writen a piece of code in my program to show spectrum:
if (BASS_ChannelIsActive(stream) == BASS_ACTIVE_PLAYING)
{
CurrentTime = BASS_ChannelBytes2Seconds(stream, BASS_ChannelGetPosition(stream, BASS_POS_BYTE));
CString PlayTime = FormatTime(CurrentTime) + " / " + FormatTime(TotalTime);
SetWindowText(SongName + " - " + PlayTime);
HDC dc;
int x,y;
DWORD result;
CString msg;
if (-1 == (result = BASS_ChannelGetData(stream, FFTData, BASS_DATA_FFT2048)))
{
return;
}
int b0=0;
float sum;
int sc,b1;
memset(specbuf,0,SPECWIDTH*SPECHEIGHT);
#define BANDS 28
for (x=0;x<BANDS;x++) {
sum=0;
b1=(int)pow(2,x*10.0/(BANDS-1));
if (b1>1023) b1=1023;
if (b1<=b0) b1=b0+1; // make sure it uses at least 1 FFT bin
sc=10+b1-b0;
for (;b0<b1;b0++)
{
sum+=FFTData[1+b0];
}
sum *= 1e38f;
y=(int)(sqrt(sum/log10(sc))*1.7*SPECHEIGHT)-4; // scale it
if (y>SPECHEIGHT) y=SPECHEIGHT; // cap it
while (--y>=0)
{
memset(specbuf+y*SPECWIDTH+x*(SPECWIDTH/BANDS),y+1,SPECWIDTH/BANDS-2); // draw bar
}
}
dc=::GetDC(m_Picture.GetSafeHwnd());
BitBlt(dc,0,0,SPECWIDTH,SPECHEIGHT,specdc,0,0,SRCCOPY);
::ReleaseDC(m_Picture.GetSafeHwnd(), dc);
this code is modified from spectrum.c in bass package. it's nessary to add sum *= 1e38f to show spectrum in my ce device, or else it didn't show correct.
but it show the spectrum correct without the (sum *= 1e38f;)statement when run it in my PC. why the return FFTData from BASS_ChannelGetData() function is different between XP and CE?(ce:about 1e-41,xp:about 1e-3?), the 1e38f is got from tries.