Trying to get the Spectrum but my channel is always 0 (C#)


(Leonidas) #1

I am trying to get the spectrum of the song (I’m new to FMOD) but the waveFormBuffer.numchannel is always zero. To get the spectrum I have followed the answers to some posts on the forum. My question is, is there anything wrong with the order of my code or the way I try to get the Spectrum?
A link to my code: https://pastebin.com/kRZVgJKs
Thanks, Leo.


(Cameron Baron) #2

It looks like because the GetSpectrum is called immediately after Play, and FMOD is asynchronous, there may not be any data in the DSP just yet.

You will also need to continually call GetSpectrum because the fftDSP.getParameterData will only return the data for that frame.

Otherwise you can use fftDSP.getBypass to see if it is actually being used.
https://fmod.com/resources/documentation-api?page=content/generated/FMOD_DSP_GetBypass.html#/