I’ve been trying to replicate de WebAudio behavior functions getByteFrequencyData and getByteTimeDomainData.
One would think it would be easily done but strangely enough, I couldn’t find any working example on how to do this with FMOD 4 or 5 (I’m not sure what version 1.08.15 translate to).
The first observation is that, while:
m_Dsp->setParameterInt(FMOD_DSP_FFT_WINDOWTYPE, FMOD_DSP_FFT_WINDOW_BLACKMAN); m_Dsp->getParameterData(FMOD_DSP_FFT_SPECTRUMDATA, (void**)&m_Data, &m_DataLength, NULL, 0);
seems to be the closest approximation of the WebAudio API.
WebAudio return decibels while FMOD returns values between 0 and 1. How could we convert the values to decibels, ultimately clamp between 0 and 255?
double maxDecibels = -30
double minDecibels = -100
Also, It seems like WebAudio is performing some smoothing while FMOD does not. What would be a good approach to smooth the frequencies result to visual sounds?
The second is that I couldn’t find any equivalent to getByteTimeDomainData which should represent the down-mixed time-domain (waveform) data. Then again, one would think it is a common thing to do but yet, I couldn’t not find any FMOD documentation on how to do this.
Any insights would be very appreciated, thank you.