0
0

Hello :-)

I’m new to FMOD. I have created a little test app in C# using the latest FMOD Ex. I am analysing the wave data and FFT graph in order to run some very simple threshold analysis, ie how often do values on the graph exceed a specified value. This works great, but I have placed this code in the OnPaint() method (not great I know but its just a quick test app). This means that the analysis is only carried out on a sample when the form is re-drawn, and therefore I assume that the analysis will ‘miss’ many samples which are being played from the MP3 file while the form is not being re-drawn.

My question is: where is the best place to carry out this analysis? Should I place the analysis in the timer_Tick() event, or is there a better location which would allow me to analyse every sample in turn coming from the mp3 file?

Hope I’ve explained that well enough.

Thanks for your time

  • You must to post comments
0
0

you may want to have a look at custom dsp examples.

  • You must to post comments
0
0

The FMOD examples uses a timer to invoke a controls Update() method (usually a picbox). However, you may also consider a backgroundworker object. I have done some analysis with Threads before, but I dont reccomend it (maybe its becuase I have bad luck with those).

If you want to catch "everything" you could probably do the analysis in a backgroundworker / timer, store the values, then draw the data with a timer that calls an Update() method. This way it calculates what it needs to, but doesnt have to draw it that often.

  • You must to post comments
0
0

Using a DSP, no need to update the system to trigger the callbacks.
Unless you are synchronizing specifically the mixer thread with update calls (which is not the default case, and not supported the same way depending on the architecture))

btw, you will have to deal with threads as the mixer thread is not in the same as the main thread (suposedly the one which created the system)

you could lock the fmod engine then access your data from the main thread for example.

  • You must to post comments
0
0

Thanks for the above help. Looking at the dsp_custom example, I think I will start by trying FMOD_DSP_READCALLBACK as that callback can be inserted into the DSP network to read the data as it passes through the DSP unit.

Thanks again for the help, much appreciated.

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.