Answered
0
0

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:
https://katyscode.wordpress.com/2013/01/16/cutting-your-teeth-on-fmod-part-4-frequency-analysis-graphic-equalizer-beat-detection-and-bpm-estimation/
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…

  • You must to post comments
Best Answer
1
0

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, …)

  • You must to post comments
1
0

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];

  • 赵城丽

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

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.