Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stopping _SNDPLAYCOPY ?Possible?
#12
(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.

Maybe we can have this in 3.15 when we make more audio-specific improvements. Wink

Instead of a new command, might I suggest a tweaking of the existing commands?

_SNDSTOP handle, (flags$)

Where the optional flag$ would be 
"ONLY" <-- this only stops the original
"COPIES"   <--- this would stop the original and any _SNDPLAYCOPY
"ALL"  <-- this would stop the original and and copies.

Would save creating another sound related keyword for folks to have to chug through and remember, when there's already a boatload of them out there.  Usage would be similar to:

Code: (Select All)
DIM AS LONG h, i

h = _SNDOPEN("explosion.wav")
_SNDPLAY h
_SNDPLAYCOPY h
_SNDPLAYCOPY h
_SNDPLAYCOPY h

_SNDSTOP h, "ONLY"   <-- to stop the _SNDPLAY with the original
_SNDSTOP h, "COPIES" <-- to stop all copies using that original handle
_SNDSTOP h, "BOTH"  <--- to stop both at once
Reply


Messages In This Thread
RE: Stopping _SNDPLAYCOPY ?Possible? - by a740g - 08-07-2024, 02:48 PM
RE: Stopping _SNDPLAYCOPY ?Possible? - by SMcNeill - 08-07-2024, 10:30 PM
RE: Stopping _SNDPLAYCOPY ?Possible? - by Pete - 08-07-2024, 03:44 PM
RE: Stopping _SNDPLAYCOPY ?Possible? - by Pete - 08-07-2024, 11:16 PM



Users browsing this thread: 21 Guest(s)