# How to get the music spectrum?

**URL:** <https://qa.fmod.com/t/how-to-get-the-music-spectrum/11485>\
**Category:** Unity\
**Created:** [May 28, 2014, 9:15am UTC](https://qa.fmod.com/t/how-to-get-the-music-spectrum/11485 "2014-05-28T09:15:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kdroben](https://avatars.discourse-cdn.com/v4/letter/k/dfb087/32.png) [@kdroben](https://qa.fmod.com/u/kdroben)\
**Post date:** [May 28, 2014, 9:15am UTC](https://qa.fmod.com/t/how-to-get-the-music-spectrum/11485/1 "2014-05-28T09:15:57Z")

</div>

Hi,  
I’ve used FMODex and designer before and now I use FMOD studio on a Unity project.  
We need to use our music frequency spectrum in the game, I used FMOD\_Channel\_GetSpectrum function on the old FMODex version but I’d like to know how to do the same thing in FMOD studio unity integration.  
I tried to based on this thread ([viewtopic.php?f=21&t=18741&p=58714&hilit=getspectrum#p58714](http://52.88.2.202/forum/viewtopic.php?f=21&t=18741&p=58714&hilit=getspectrum#p58714)) but it seems some enum don’t be define in the unity wrapper (FMOD\_DSP\_FFT, FMOD\_DSP\_PARAMETER\_FFT …).  
Does anyone know how to get the spectrum C #?

Regards,

---

<div class="post-metadata">

**Author:** ![Guest1](https://avatars.discourse-cdn.com/v4/letter/g/ecccb3/32.png) [@Guest1](https://qa.fmod.com/u/Guest1)\
**Post date:** [June 26, 2014, 1:06am UTC](https://qa.fmod.com/t/how-to-get-the-music-spectrum/11485/2 "2014-06-26T01:06:30Z")

</div>

Hi Hirdannen,

Thanks for the report, we noticed this just after the 1.04.01 release went out. The windows release has an updated fmod\_dsp.cs with all of the enums defined, so as a short term fix you can just download the windows installer and pull in the fmod\_dsp.cs from there. The next release will have all the enums in the Unity wrapper, it should be available in the next couple of days.

---

<div class="post-metadata">

**Author:** ![Hirdannen](https://avatars.discourse-cdn.com/v4/letter/h/b4bc9f/32.png) [@Hirdannen](https://qa.fmod.com/u/Hirdannen)\
**Post date:** [June 17, 2014, 10:44pm UTC](https://qa.fmod.com/t/how-to-get-the-music-spectrum/11485/3 "2014-06-17T22:44:38Z")

</div>

The methodology is clearly explained, however in C++ the enums are defined, not in the C# Unity integration : FMOD\_DSP\_FFT\_WINDOWTYPE, DSP\_FFT\_FREQ and others are missing. Without the enums, setParameter and getParameter can’t seem to be used properly. I managed to, manually, find an index for a song to retrieve the spectrum. However it changed as soon as I added, in FMOD studio, any additionnal parameter.

Do we have to define ourselves the enums ? Or is it merely a bug ?

---

<div class="post-metadata">

**Author:** ![Guest1](https://avatars.discourse-cdn.com/v4/letter/g/ecccb3/32.png) [@Guest1](https://qa.fmod.com/u/Guest1)\
**Post date:** [June 12, 2014, 12:17am UTC](https://qa.fmod.com/t/how-to-get-the-music-spectrum/11485/4 "2014-06-12T00:17:48Z")

</div>

There is information on getting the spectrum in FMOD 5 (FMOD Studio Low-Level) in this thread: [viewtopic.php?f=21&t=18741](http://52.88.2.202/forum/viewtopic.php?f=21&t=18741)
