0
0

Hello fellow programmers :), I’m very new to fmod and sound related programming in general, I’m working on a small openGL demo and i want to sync some effects with the music I’ll be playing. The problem is that my code doesn’t work properly :(.

Here’s the visualization of the spectrum:
[img:1jwzu34m]http://www.allegro.cc/images/rcache/6c313d7c8d357f9f84b068d6810b143d.png[/img:1jwzu34m]

Here’s all the fmod related code i use:
[code:1jwzu34m]
FMOD_System_Create(&fmod_system);
FMOD_System_Init(fmod_system, 16, 0, NULL);

FMOD_System_CreateSound(fmod_system, "music.mp3", FMOD_2D, NULL, &music);

//called everytime i visualize the spectrum
FMOD_System_GetSpectrum(fmod_system, spectrum, 512, 0, FMOD_DSP_FFT_WINDOW_TRIANGLE);

[/code:1jwzu34m]
Where spectrum is an float array of size 512.

The sound plays but FMOD_System_GetSpectrum returns 0 for some reason.

  • You must to post comments
0
0

If you read the docs you’ll see that System::getSpectrum puts the spectrum data in the spectrumarray you have in the argument and returns an error code. The 0 you get is in fact FMOD_OK.

  • You must to post comments
0
0

I see… ><, but if it says it’s ok why doesn’t it work :S? any ideas? I’m sure the non-fmod related code is OK.

  • You must to post comments
0
0

How does it not work? What’s in the array you get back?

  • You must to post comments
0
0

The array contains float values, in the picture i posted before the green lines represents different parts of the spectrum which has a size of 512. as you can see the spectrum takes a form, but the form does not change even if i try to update it.. the float array is cleaned before i use it… (the music is playing)

  • You must to post comments
0
0

check the ‘dsppluginviewer’ example, it displays the spectrum in a window.

  • You must to post comments
0
0

Thank you! It works now :).

  • You must to post comments
0
0

Hello,

Mr. Albin can you hepl me please? I have a maturia project and I need draw the spectrum and I worried with it probles. Cau you hepl me please a little code with the use ?

Thank you Carda

  • You must to post comments
Showing 7 results
Your Answer

Please first to submit.