# Vizualizing sounds

**URL:** https://qa.fmod.com/t/vizualizing-sounds/12952
**Category:** FMOD Engine
**Created:** [January 29, 2017, 5:51pm UTC](https://qa.fmod.com/t/vizualizing-sounds/12952 "2017-01-29T17:51:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![neosettler1](https://avatars.discourse-cdn.com/v4/letter/n/c2a13f/32.png) [@neosettler1](https://qa.fmod.com/u/neosettler1)
#### Post date: [January 29, 2017, 5:51pm UTC](https://qa.fmod.com/t/vizualizing-sounds/12952/1 "2017-01-29T17:51:46Z")

</div>

Grretings,

I’ve been trying to replicate de WebAudio behavior functions getByteFrequencyData and getByteTimeDomainData.

See doc here: [https://webaudio.github.io/web-audio-api/#fft-windowing-and-smoothing-over-time](https://webaudio.github.io/web-audio-api/#fft-windowing-and-smoothing-over-time)

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.

---

<div class="post-metadata">

### Author: ![brett](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/brett/32/261_2.png) [@brett](https://qa.fmod.com/u/brett)
#### Post date: [January 31, 2017, 2:24am UTC](https://qa.fmod.com/t/vizualizing-sounds/12952/2 "2017-01-31T02:24:21Z")

</div>

There is documentation about capturing/displaying PCM data. it talks about getspectrum and getwavedata which was in fmod ex.

> “Add a custom DSP unit to capture DSP wavedata from the output stage.  
> Use the master channelgroup’s DSP head with  
> System::getMasterChannelGroup and ChannelControl::getDSP. Add a built  
> in FFT DSP unit type to capture spectrum data from the output stage.  
> Create a built in FFT unit with System::createDSPByType and  
> FMOD\_DSP\_TYPE\_FFT, then add the effect to the master ChannelGroup with  
> ChannelGroup::addDSP. Use DSP::getParameterData to get the raw  
> spectrum data or use DSP::getParameterFloat to get the dominant  
> frequency from the signal.”

Scaling the fft values is up to the user at this point. You might have to scale it yourself based on tests to make it match webaudio, I can’t give you the answer about db at this point.

---

<div class="post-metadata">

### Author: ![neosettler1](https://avatars.discourse-cdn.com/v4/letter/n/c2a13f/32.png) [@neosettler1](https://qa.fmod.com/u/neosettler1)
#### Post date: [January 31, 2017, 4:59am UTC](https://qa.fmod.com/t/vizualizing-sounds/12952/3 "2017-01-31T04:59:26Z")

</div>

I see how to get the frequency domain clearly thank you sir. So in short, there is no documentation nor examples on how to get the wave time domain!?
