Thread: Error with FMOD getSpectrum()

  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    2

    Error with FMOD getSpectrum()

    I know this isn't truly "game" programming, but the board said sound library stuff goes here too, if It's int he wrong spot, a mod is more than welcome to move it.

    Anywho, I was really used to FMOD 3.75, and I just got the newer version, 4.32.04, and I have to say, the FMOD team really messed up on this, in my opinion.

    In the old version, I am used to activating DSP effects when I initialize FMOD, and this allowed me to access the getSpectrum() function quite easily, now all that happens is a crash.

    Code:
    float *spectrum;
    FmodSystem->getSpectrum(spectrum, 256, 0, FMOD_DSP_FFT_TRIANGLE);
    This gives me a segmentation fault. Googling around didn't help me much, mostly people saying they always get 0.0 on the spectrum.... wish I could get that far....

    Anyway, I don't see a way to initialize FMOD with DSP active on it, and the help file isn't giving me anything that I can find. I have tried it with all the filters, both channels, channel->getSpectrum, everything I could think of.

    Any ideas on why this is segfaulting?

    Thanks in advance.

  2. #2
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Without knowing anything about FMOD a couple of things in that line of code that could cause seg faults:
    • FmodSystem has not been initialized nor zeroed in the constructor of your object. If it were null you would get a null pointer error. If it was not zeroed and you attempted to use it and it was not valid you could get a seg fault.
    • You have a DLL problem. If FMOD is a DLL I would check to ensure the DLL is in the bin of your application. If it is not a DLL then ignore this.
    • getSpectrum() may have some invalid parameters being passed to it. Invalid as in they meet the prototype but they are causing FMOD to do some strange things.
    • Last and least likely: getSpectrum() has a bug in it which causes the seg fault.

  3. #3
    Registered User
    Join Date
    Oct 2010
    Posts
    2
    I have played around with the parameters, always got the same result.

    I fear it is the last option. I can play sound without a problem, pause it, resume it, you name it, I can do it, except for DSP effects and spectrums. I have not yet tried the effects.

    Has anyone else had this problem? I am running kubuntu 10.04, using GCC/G++ through Code::Blocks... Could this be a compiler error?

    Oh and, Thanks for responding, Bubba.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. FMOD Decides it doesn't want to...
    By cboard_member in forum Game Programming
    Replies: 10
    Last Post: 02-16-2006, 06:39 AM
  2. FMOD implimentation, how'd you do it?
    By Jeremy G in forum Game Programming
    Replies: 10
    Last Post: 06-12-2004, 12:04 AM
  3. more fmod questions
    By lambs4 in forum Game Programming
    Replies: 0
    Last Post: 05-20-2004, 04:33 PM
  4. error with fmod() function
    By minesweeper in forum C++ Programming
    Replies: 3
    Last Post: 08-30-2003, 05:24 AM
  5. Fmod and windows programming
    By AtomRiot in forum Windows Programming
    Replies: 1
    Last Post: 01-06-2003, 03:13 PM