samples in Visual plug-in

Discussions for GoldWave plug-in development
Post Reply
goldplate
Posts: 2
Joined: Tue Sep 29, 2009 4:31 am

samples in Visual plug-in

Post 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
GoldWave Inc.
Site Admin
Posts: 4372
Joined: Wed Mar 10, 2004 6:43 pm
Location: St. John's, NL
Contact:

Re: samples in Visual plug-in

Post 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
goldplate
Posts: 2
Joined: Tue Sep 29, 2009 4:31 am

Re: samples in Visual plug-in

Post by goldplate »

Thanks for that, I hadn't realised I had received a response hence the belated acknowledgement.
Post Reply