Weird results when retrieving both FFT and wavedat

Started by Led,

Led

In my app I've hooked a timer to an eventhandler.

The handler then requests FFT data (2048) and Wavedata(1024 samples) from the RecordChannel.

Then I draw the FFT-data using practically the same code as in Livespec.

* My spectrum looks totally different. *
(than livespec's)

when I only do the FFT-fetching, but not the waveform - everything looks fine.

My guess :
my handler is taking too much time when requesting waveform-data too.
When requesting data from the RecordChannel, is it just a copy of an internal-BASS-buffer or is it actually going to fetch it from the device (which would prolly be dead slow since it's already been captured by Bass I guess)..?

Should I use a record-handler instead and do my own FFT on the data that's being sent to the handler..?

Led

Okay, this is quite a fast comeback :)

Part 2:

When I request the waveform-data first and then the FFT, my spectrum-view looks weird.

When I do it the other way around (first FFT, then Wave)
everything seems fine & dandy.

Ian, can you put my mind at ease and give me a simple explanation for this behaviour ?
(Otherwise I'll keep thinking up 'probable cause's' while I'm asleep :))

Ian @ un4seen

Are you using a recording callback?

When not using a recording callback, each call to BASS_ChannelGetData removes data from the recording buffer. So if you're calling it frequently, there's unlikely to be sufficient data, and you'll be returned less than you asked for. Calling it too infrequently would be even worse :)

So, in summary, use a recording callback (like in the LIVESPEC example), and you should be ok :)