0
0

1) seems the fmod studio lowlevel api is quite similar, yet I wonder if there is some documentation about all api changes?

2) it appears the lowlevel api (fmod[64].dll( is the ‘new fmodex[.dll], yet I find it confusing regarding the original, obsolete fmod.dll. Anyway, using this new fmod dll, would it be ok to call it "FMOD [Studio] Soundsystem"?

3) Is there any substitute for System_GetSpectrum?

4) CD playback still does not work in 64bit (fmod64.dll from fmod studio) (FMOD_ERR_CDDA_INIT)

  • You must to post comments
0
0

Okay, now I’m encountering a different error using the code you provided (just to see what happens, didn’t really expect it to magically work) in my code, with name changes so it would fit. Basically when I do the getParamtereData() result is equal to FMOD_ERR_MAXAUDIBLE. I looked in the documentation and noticed it said that it means I’ve surpassed the max playback count from the soundgroup in question – but I haven’t defined any soundgroups? So do I need to or can something else cause this error? And what benefit is there in using soundgroups exactly?

  • You must to post comments
0
0

beat detection is a pretty big topic, i’ve tried it myself once and it was pretty rudimentary and i scrapped it – i think the link you gave is a lot more researched than anything we have in our back pocket :)

  • You must to post comments
0
0

Hi,
FMOD_ERR_MAXAUDIBLE is only ever going to be returned from System::playSound, not getParameter. I expect you have a lib and header mixup. Please make sure you have the two in sync.

  • You must to post comments
0
0

Hi ,
for your questions

1) yes there is a page in the documentation with differences between fmodex and fmod studio low level.
2) what are you asking to call? FMOD Studio is the name of the product, i’m not sure where you want to put that.
3) yes, add a FMOD_DSP_TYPE_FFT dsp, and you can use getParameter to get the old info, including a new float called ‘dominant frequency’.
4) we’re removing CDDA support in the next release of FMOD Studio (though its still in 1.2), its time to move on from this old format.

  • You must to post comments
0
0

[code:22fmeum7]If (FMOD_System_GetMasterChannelGroup(hSystem, @hMasterChannelGroup) = 0)
{
If (hMasterChannelGroup)
{
If (FMOD_System_CreateDSPByType(hSystem, FMOD_DSP_TYPE_FFT, @hDSP) = 0)
{
If (hDSP)
{
If (FMOD_DSP_SetParameterInt(hDSP, FMOD_DSP_FFT_WINDOWSIZE, 1024) = 0)
{
If (FMOD_DSP_SetParameterInt(hDSP, FMOD_DSP_FFT_WINDOWTYPE, FMOD_DSP_FFT_WINDOW_RECT) = 0)
{
If (FMOD_ChannelGroup_AddDSP(hMasterChannelGroup, FMOD_CHANNELCONTROL_DSP_HEAD, hDSP, 0) = 0)
{
xResult = True;
}
}
}
If (!xBool1)
{
If (FMOD_DSP_Release(hDSP) = 0)
{
hDSP = 0
}
}
}
}
}
}
[/code:22fmeum7]
Should work for initializing the DSP – unless by changing from purebasic to a c/c++ like syntax I haven’t made any mistake.
With the new insight that the spectrum data parameter, the player seems to work stable again, but no spectrum shown anyway.
BTW, is this old spectrum routine fully backwards compatible with older fmod studio low level api versions?
[b:22fmeum7]EDIT: Fixed FMOD_DSP_Release() = 0, instead of FMOD_DSP_Release(hDSP) in code[/b:22fmeum7]

  • You must to post comments
0
0

Yeah I’m unable to get any useful data either.

Does anyone else have any experience with this? 😕

  • You must to post comments
0
0

[quote="brett":3uq9nkfh]Hi,
FMOD_ERR_MAXAUDIBLE is only ever going to be returned from System::playSound, not getParameter. I expect you have a lib and header mixup. Please make sure you have the two in sync.[/quote:3uq9nkfh]

Sorry, I’m a bit confused then. What header files should I be using with the lowlevel api then? I currently just use <fmod.hpp>.

Thanks!

  • You must to post comments
0
0

[quote="brett":38qzlyo0]
3) yes, add a FMOD_DSP_TYPE_FFT dsp, and you can use getParameter to get the old info, including a new float called ‘dominant frequency’.[/quote:38qzlyo0]

So, as a total noob who’s not sure which getParameter function I should be using, nor how to properly use any of the said functions, could some sample code perhaps be posted of how to do something basic that is similar in functionality to getSpectrum from FMOD EX?

Also, sorry for bumping an old thread.

Thanks!

  • You must to post comments
0
0

you use fmod.hpp

The issue is that it looks like you have versions of fmod headers mixed up with versions of the lib/dll files.

  • You must to post comments
0
0

poked around a bit, but seems pretty undocumented for some reason.

I assume this should give some infos for a trial and error attempt:
typedef enum
{
FMOD_DSP_FFT_WINDOWSIZE, /* (Type:int) – [r/w] Must be a power of 2 between 128 and 16384. 128, 256, 512, 1024, 2048, 4096, 8192, 16384 are accepted. Default = 2048. /
FMOD_DSP_FFT_WINDOWTYPE, /
(Type:int) – [r/w] Refer to FMOD_DSP_FFT_WINDOW enumeration. Default = FMOD_DSP_FFT_WINDOW_HAMMING. /
FMOD_DSP_FFT_SPECTRUM, /
(Type:data) – [r] Returns the current spectrum values between 0 and 1 for each ‘fft bin’. Divide the niquist rate by the window size to get the hz value per entry. /
FMOD_DSP_FFT_DOMINANT_FREQ /
(Type:float) – [r] Returns the dominant frequencies for each channel. */
} FMOD_DSP_FFT;

This should be the 4 parameters the fft dsp has, and how to use.

  • You must to post comments
0
0

Huh. Which libs should I be using then (specifically, for release / debug with visual studio)? I specify the directory as the FMOD Lowlevel API, but atm am not sure which libraries I’m specifying to be used (I’ll post later when I can check!).

  • You must to post comments
0
0

Sorry for the bump but figuring this out is somewhat time critical. I seem to use both fmod_vc.lib and fmodL_vc.lib in both the debug and release versions. All I can seem to find on the subject is that L is for logging/debugging purposes? Really confused atm. =S

  • You must to post comments
0
0

I guess my only remaining question now that I have this information is about the function DSP::getParameterData(). I get that index is the index I want to get the data from in the DSP type, and that data is where the data is essentially written, but length – what is length referring to? And can I set valuestr, and valuestrlen to NULL?

Thanks again!

  • You must to post comments
0
0

What Brett was talking about regarding header / library mix up is the case where a developer uses headers for one version of FMOD with libraries from a different version. If the list of error codes has changed between two versions the library might return one error, but your incorrect headers say it is something different. Just make sure you are using the headers, libs and DLLs all from the same release of FMOD to avoid this problem.

As for which libs to use, we recommend you use fmod_vc.lib in your release version and fmodL_vc.lib for your debug version. The ‘L’ means logging, this will provide extra information on the TTY or fmod.log file about what FMOD is doing (which is useful for debugging).

  • You must to post comments
0
0

played around a bit myself, but couldn’t get FMOD_DSP_SetParameterInt with #FMOD_DSP_FFT_WINDOWSIZE and #FMOD_DSP_FFT_WINDOWTYPE to work at all.

FMOD_DSP_GetParameterData with FMOD_DSP_FFT_SPECTRUM seems to return sucessfull / without crash, but I get no spectrum data so far. Also don’t know how to specify which channel (left/right) to get the spectrum from.

for the length parameter, I assume it is some kind of (optional) pointer.
for valuestr and valuestrlen passing 0 seems to work (its not stated optional in the documentation, so I’d recommend specifying (valuestr as pointer to 16 bytes of memory, valuestrlen 16), however, I wonder why the valuestrlen is relevant if there is a 16 byte limit.
it should return some (ansi?) text to the memory specified in valuestr, but does not.

  • You must to post comments
0
0

Ohhhhhh, that makes A LOT more sense. I was so confused as to what I was doing wrong. xD

EDIT: Solve my own problem. =D

  • You must to post comments
0
0

Hi ,
The FMOD_DSP_TYPE_FFT effect is a bit underdeveloped/documented compared to the rest of the effects. Hopefully I can clear up some confusion (i’m also in the process of updating the documentation for it, and changing the ‘data’ to a struct so you can get a bit more info out of it).

Firstly the valuestr/valuestrlen is unused right now because there’s no real way to make a string out of something that’s not a scalar value – so i’ve updated it to just return the string "spectrum data" for the next release.

Next, "length" of data is how many floats there are. This is window size * channels in signal. 1024 window size in a stereo dsp chain, should return 2048 for example as length.
As for the spectrum, it contains float data for each channel, up to window_size values.

Just debugging now – it looks like each channel is 16384 floats apart from each other.
so in a 2 channel signal,

left = data + 0 = first ‘window_size’ # of floats. then right = data+16384 = next window_size of floats. Every 16384 floats there are more channels (ie up to 32 channels).
This is a lot of memory (2mb) which took me by surprise so i might reduce that somewhat in the next release.

When I debugged it the values came through ok. I tested on a sine wave using a triangle window (triangles are really only good for periodic tones like sine waves btw).

Note the data only starts coming through when a signal is heard, not when the signal path is idle.

  • You must to post comments
0
0

Alright so I’ve got the errors to go away, but I cannot for the life of me extract any useful data. I’m using VS2012, and when I try to debug and see what’s in data all I can see is the value 0.00000 (which it is initialized to). When I step through and check the values of the frequency array, those only meet the "else" condition, meaning instead of being == average / power it results in a 0.

Here’s the code I’m using (the other parts of the example code that Brett posted are initialized when I initialize my game’s audio manager.

[code:1k3aftm4] char s[256];
unsigned int len;
float *data = 0;
float freq[32];

result = dspfft-&gt;getParameterData(FMOD_DSP_FFT_SPECTRUM, (void **)&amp;data, &amp;len, s, 256);

if (result != FMOD_OK)
{
    std::cout &lt;&lt; &quot; FMOD !OK \n&quot;;
}

nyquist = windowsize / 2;

for (int chan = 0; chan &lt; 2; chan++)
{
    float average = 0.0f;
    float power = 0.0f;

    for (int i = 0; i &lt; nyquist-1; ++i)
    {
        float hz = i * (rate * 0.5f) / (nyquist-1);
        int index = i + (FLOAT_BETWEEN * chan);

        if (data[index] &gt; 0.0001f)
        {
            average += data[index] * hz;
            power += data[index];
        }
    }

    if (power &gt; 0.001f)
    {
        freq[chan] = average / power;
    }
    else
    {
        freq[chan] = 0;
    }
}[/code:1k3aftm4]
  • You must to post comments
0
0

Here is code that works under the current release

[code:3fpuam8q]
if (dspfft)
{
float val;
char s[256];
unsigned int len;
float *data = 0;
float freq[32];
int rate, chan,nyquist;
int windowsize = 4096;

        result = gSystem-&gt;getSoftwareFormat(&amp;rate , 0, 0);
        ERRCHECK(result);

        result = dspfft-&gt;setParameterInt(FMOD_DSP_FFT_WINDOWTYPE, FMOD_DSP_FFT_WINDOW_TRIANGLE);
        ERRCHECK(result);

        result = dspfft-&gt;setParameterInt(FMOD_DSP_FFT_WINDOWSIZE, windowsize);
        ERRCHECK(result);

        result = dspfft-&gt;getParameterFloat(FMOD_DSP_FFT_DOMINANT_FREQ, &amp;val, 0, 0);
        ERRCHECK(result);

        result = dspfft-&gt;getParameterData(FMOD_DSP_FFT_SPECTRUM, (void **)&amp;data, &amp;len, s, 256);
        ERRCHECK(result);

        nyquist = windowsize / 2;

        for (chan = 0; chan &lt; 2; chan++)
        {
            float average = 0.0f;
            float power = 0.0f;

            for (int i = 0; i &lt; nyquist-1; ++i)
            {
                float hz = i * (rate * 0.5f) / (nyquist-1);
                int index = i + (16384 * chan);

                if (data[index] &gt; 0.0001f) // aritrary cutoff to filter out noise
                {
                    average += data[index] * hz;
                    power += data[index];
                }
            }

            if (power &gt; 0.001f)
            {
                freq[chan] = average / power;
            }
            else
            {
                freq[chan] = 0;
            }
        }
        printf(&quot;\ndom freq = %d : %.02f %.02f\n&quot;, (int)val, freq[0], freq[1]);
    }

[/code:3fpuam8q]

  • You must to post comments
0
0

did you actually add the dsp into the signal somewhere? Ie with addDSP?

  • You must to post comments
Showing 1 - 20 of 22 results
Your Answer

Please first to submit.