Page 1 of 1

samples in Visual plug-in

Posted: Tue Sep 29, 2009 4:45 am
by goldplate
When developing a visual plug-in I have discovered that the waveform samples passed to the plug-in during playback are not contiguous.

Due to the nature of my plug-in this is a fatal problem. There doesn't seem to be any reference to this fact in the documentation.

Does anyone have any further information on this? For instance if the blocks of 4096 samples were overlapped in any deterministic sense it may be possible
to extract a contiguous sample stream.

Any thoughts at all would be welcome.

Cheers,

Gary

Re: samples in Visual plug-in

Posted: Tue Sep 29, 2009 9:28 pm
by GoldWave Inc.
Waveform data is not contiguous. It is a snapshot of the waveform at a given instant in time. The time for each frame varies with the frame rate setting and system load. You'll need to use the time value to determine the exact time for the waveform data. That will allow you to determine if the data overlaps or skips. At 60fps without any slowdown, a 44100Hz sampling rate will have a significant overlap, which you can adjust for using the time value to get contiguous data. At 20fps, a 192000Hz sampling rate will skip and contiguous data will not be available.

Essentially you'd save the time value from the previous Draw call and compare it to the new time value to see how much time has passed between calls. From that you can determine exactly how many new samples have been added to the end of the waveform buffer (if no skipping occurred).

Chris

Re: samples in Visual plug-in

Posted: Sun Feb 17, 2013 4:54 am
by goldplate
Thanks for that, I hadn't realised I had received a response hence the belated acknowledgement.