03-03-2023, 09:41 PM
I think you're issue is that you don't pass the _SndRaw handle to
Note also that your
_SndRawLen(). The regular _SndRawLen with no parameter does not include sound for other opened raw handles, so it always returns zero and you'll write all the data to _SndRaw with no delay. Using
_SndRawLen(RAWSND)returns the correct time remaining for the handle.
Note also that your
Do until _SndRawLen < 0.1: Loopis a busy loop - it will continue to use up CPU time while waiting and effectively use as much CPU as the OS will let it. Adding a small _Delay such as
_Delay .01inside that loop drastically reduces CPU usage for me, and it still plays smoothly because there's no real risk of the sound buffer running empty when you're aiming to keep it at .1 seconds full.