DirectSound Param Equalizer filter/effect

Ab99402541052e4ec9e0261a72ff5541
0
code2K 101 Mar 23, 2007 at 15:07

Hi, Does anyone know how to filter Low Mid High frequencies throughout a secondary buffer of sound in ONE GO, RATHER THAN letting the mixer mix it into the Primary in realtime when it is played, which causes latency.

I am doing the latter already, using the IID_IDirectSoundFXParamEq8 interface to set param equalizer effects, -but would prefer to apply the filtering to the entire secondary buffer before playing it. Is something like this possible ?

2 Replies

Please log in or register to post a reply.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 168 Mar 23, 2007 at 17:11

Well, I don’t know exactly how equalizers work, but it’s related to the Fourier transform. You break the sound data into “frames” of N samples long (usually N is a small power of two, like 8 or 16) and do a discrete Fourier transform (DFT) on each one. The DFT starts with N samples in the time domain and results in N samples in the frequency domain; you can then scale the power levels in the low/mid/high frequency ranges as you desire and apply the inverse DFT to get back to the time domain. You can use a larger frame length to get a finer granularity of frequency control, but it will be slower to process.

Ab99402541052e4ec9e0261a72ff5541
0
code2K 101 Mar 23, 2007 at 17:27

Thanks for that. I think probably for myself the best approach would be to use some DirectSound technique and let it do the processing but I can’t for the moment see any DSound funtion that allows me to process a whole chunk of sound data before I play it back on the sound buffer. Any ideas ???