0
0

Sorry, I’ve tried searching to avoid writing a topic answered before but didn’t find anything. I’ve found that using FMODs method of getting the frequency doesn’t work on streams, is this true? I thought that it would get whatever was being played through FMOD, am I doing anything wrong?

  • You must to post comments
0
0

You have to assign a channel to the stream just opened

[code:pm86buvf]
var Ch: integer;

Ch:= FSOUND_Stream_Play(MyOpenedStream, Flags, 0, 0);
[/code:pm86buvf]

then you can access the frequency trhu the channel

[code:pm86buvf]
FSOUND_GetFrequency(Ch);
[/code:pm86buvf]

That’s all 😉

  • You must to post comments
0
0

Ehm, post misread, now I see you want the spectrum, not frequency.
To get the spectrum from a stream you have to turn on the FFT unit, disabled by default

[code:24xjjbh5]
var P: pointer;

P:= FSOUND_GETFFTUnit;
FSOUND_SetActive(P, True);
[/code:24xjjbh5]

Now you have access to spectrum data calling GetSpectrum

[code:24xjjbh5]
type TData: Array[0..511] Of Single;

var Data: @TData;

Data:= FSOUND_GetSpectrum;
[/code:24xjjbh5]

NOW that’s all! :)

  • You must to post comments
0
0

[quote="brett":2nj4wlsq]streams will show up the same as samples in the spectrum, there is nothing special about them. Only if they are FSOUND_HW2D or FSOUND_HW3D they wont show up because they are not playing in fmod’s dsp system.[/quote:2nj4wlsq]

Ah that’ll be it, dang cos I really want to use HW2D to make sure that they start playing with the minimum delay. Oh well, I guess I can calculate it myself thru callbacks, just was getting a bit confused when the spectrum was returning me a blank array.

  • You must to post comments
0
0

[quote="identitycrisisuk":1nwklu75]dang cos I really want to use HW2D to make sure that they start playing with the minimum delay.[/quote:1nwklu75]

Umm, FMOD is pretty damn fast, and I would think that in alot of circumstances it would be faster at starting a sound playing than the hardware is.

I have completely given up on hardware and leave FMOD to handle everything, it works better and more consistantly (for me anyway ;))

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.