Platform – WinXP
FMOD – 3.75
I want to write an 10 band equalizer affecting all sounds played
The Init is done in a seperate class responsible for setting up the sound environment. I call it CSNDCard
Here is a code snippet:
define MIXRATE 44100
if (!FSOUND_Init(MIXRATE , 32, FSOUND_INIT_GLOBALFOCUS | FSOUND_INIT_ENABLESYSTEMCHANNELFX))
throw InitException(FE_CODE_MSSInit, FE_MSG_MSSInit);
nFXID = FSOUND_FX_Enable(FSOUND_SYSTEMCHANNEL,FSOUND_FX_PARAMEQ);
Sounds are played by use of CSound Class:
The Sample is loaded in that way:
pSoundSample = FSOUND_Sample_Load(FSOUND_FREE, pSoundData, FSOUND_LOADMEMORY|FSOUND_HW2D | FSOUND_ENABLEFX, 0, filesize);
and here is the play method:
[code:23y1zlyl] nChannel = FSOUND_PlaySoundEx(FSOUND_FREE, pSoundSample, NULL, true);
Whenever I modify the equalizer setting I do like following:
[code:23y1zlyl]#define MIN_LIMIT_GAIN -15
define MAX_LIMIT_GAIN 15
void CBASESound::SetEqualizer(int nCenterFrq, int nBandWidth, int nGain)
if (nGain < MIN_LIMIT_GAIN)
nGain = MIN_LIMIT_GAIN;
if (nGain > MAX_LIMIT_GAIN)
nGain = MAX_LIMIT_GAIN;
bool eqresult = (bool)FSOUND_FX_SetParamEQ(nFXID,nCenterFrq, nBandWidth, nGain);
and now (finally) my question:
When I load the sound with (FSOUND_HW2D) no equalizer FX are working
and when I load it with FSOUND_NORMAL the equalizer is working but there is a latency when starting the sound. That means that it takes approx 1sec from starting the sound until I hear it.
Any help is greatly appreciated…
- bommel asked 11 years ago
[quote="bommel":3v1qoa7f]The target platform runs on Pentium M/1 GHz. You think I should forget that equalizer?[/quote:3v1qoa7f]
There are some other cons in using that equalizer:
Lowest center frequency is just 80Hz. That’s not enough for some applications.
Setting gain to 0 (default) attenuates the signal. It shouldn’t but it does.
The only pro is it’s availability (for free) on DX8.
Finally, to answer your question, if it’s too slow on the target platform, try optimizing your DirectSound output. There’s a very nice (a bit out of date) paper by Peter Clare: h**p://www.sensaura.com/whitepapers/pdfs/devpc014.pdf
[quote="Quantum":1jclbtlk]Parameq is available on DX 8 or later. It doesn’t work well on slow machines. Even a single parameq instance almost doubles cpu usage on my PIII. I think it computes an FFT and IFFT for every instance. That’s not good at all.[/quote:1jclbtlk]
The target platform runs on Pentium M/1 GHz. You think I should forget that equalizer?
- bommel answered 11 years ago
Please login first to submit.