1
QB64 Discussion / Re: _sndraw Delay
« on: March 29, 2020, 05:05:30 am »
Thanks for the Tip, yep, i´ve created a small buffer which is been filled on one segment wile the other segment is being played back. The _sndraw command sits in its own routine, called repeaditly by a 5 msec Timer, and this routine is not leaved unless the current "buffer" has been played back (not waiting yields to a constantly rising memory usage of the entire process; i guess because of a race condition between buffer output and input) and doesn´t help either on the delay issue).
This works quite well except for the audible delay when initiating the "playback". I know that _sndraw is designed for continuous playback, but otherwise i cannot imagine how to hold _sndraw in playback state while it does circulate through memory boundaries by itself - and modifying the memory contents by another routine - and if this could solve the problem. Knowing the current playback position is also vital for calculating the waveform...
I´d like to keep the all buffers as short as possbile, to react on changes (caused by the waveform generation routine) as quick as possbible. It hasn´t to be in the area of ASIO or JACK/ALSA-like Latencys, but a 20-30 msec delay (at least if that could be handled by the hardware and drivers) would be great.
This works quite well except for the audible delay when initiating the "playback". I know that _sndraw is designed for continuous playback, but otherwise i cannot imagine how to hold _sndraw in playback state while it does circulate through memory boundaries by itself - and modifying the memory contents by another routine - and if this could solve the problem. Knowing the current playback position is also vital for calculating the waveform...
I´d like to keep the all buffers as short as possbile, to react on changes (caused by the waveform generation routine) as quick as possbible. It hasn´t to be in the area of ASIO or JACK/ALSA-like Latencys, but a 20-30 msec delay (at least if that could be handled by the hardware and drivers) would be great.