Frequency analysis

Hi,

I’m new on FMOD and it looks very cool to me.
I’m trying to get a frequency spectrum with the low-level-api but I can’t find any information how this will work.
First I try this:


The Problem is that “Channel::getSpectrum(…)” no longer exist, or?
So… can anyone telle me how is the right way to to this with the new version?

Greez
Joseman

btw:
I hope my english is good enough…

Create a FFT DSP and add it to the channel. You can then query the frequency domain data using DSP::getParameterData(FMOD_DSP_FFT_SPECTRUMDATA, …)

2 Likes

Hallo,

I’ve got it. Thanks.
The Code:

FMOD::DSP* dsp;
mFMODSystem->createDSPByType(FMOD_DSP_TYPE::FMOD_DSP_TYPE_FFT, &dsp);
mFMODSystem->playSound(mSound, 0, false, &channel);
channel->addDSP(FMOD_DSP_PARAMETER_DATA_TYPE_FFT,dsp);
FMOD_DSP_PARAMETER_FFT *fft;
dsp->getParameterData(FMOD_DSP_FFT_SPECTRUMDATA, (void **)fft, 0, 0, 0);
for (int channel = 0; channel < 1; channel++)
for (int bin = 0; binlength; ++bin)
float freqVal = fft->spectrum[channel][bin];

1 Like

hello,can you write code complete?I’ve had the sample problem as you.