08-07-2024, 07:06 PM
(08-07-2024, 05:57 PM)madscijr Wrote:You would still need to manage all those returned handles with an array.(08-07-2024, 03:14 PM)TerryRitchie Wrote:Is it possible to tweak _SNDPLAYCOPY to return a handle?(08-07-2024, 02:48 PM)a740g Wrote: I think _SNDSTOPCOPIES may be a good idea. A fair amount of complexity is involved in getting this done on the BASIC side using arrays, _SNDCOPY & _SNDCLOSE. There is no way to stop and dispose of copies until it finishes playing. Also, the C++ side implementation is trivial.Thank you for considering this.
Maybe we can have this in 3.15 when we make more audio-specific improvements.
Oh yeah, that's right, as you point out _SNDCOPY will make another instance in RAM than needs to be removed with _SNDCLOSE. More overhead that I didn't consider.
(08-07-2024, 11:17 AM)SpriggsySpriggs Wrote: Why wouldn't we use handles for this?_SNDPLAYCOPY doesn't return a handle but instead handles all sound management internally.
_SNDPLAYCOPY internally copies a new instance of the sound, plays it, then removes the new instance. The grunt work is already being handled by _SNDPLAYCOPY since it needs to keep track of all those new handles. A new command such as _SNDSTOPCOPIES could simply use that internal list created by _SNDPLAYCOPY to stop all the copied associated handles.