Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stopping _SNDPLAYCOPY ?Possible?
#3
(08-07-2024, 12:58 AM)SMcNeill Wrote: Not to say it's a bad idea or anything, but how the heck would one implement it?

Let's say me hero has a zappy gun.   I load the "pew pew" sound file.

I fire off three zaps.

_SNDPLAYCOPY  "pew pew"
_SNDPLAYCOPY  "pew pew"
_SNDPLAYCOPY  "pew pew"

Now, the second one hits the enemy.   How would _SNDSTOPCOPY know to stop that second "pew pew" and not the first or third?  Wouldn't it need a handle to specify which sound to actually stop?

And if it does, then wouldn't it basically be the exact same as _SNDCOPY?

How could you ever specify which copy to stop, without a handle, and if you have a handle, why wouldn't the existing commands already handle the issue?
I'm suggesting that _SNDSTOPCOPY would stop all copies of a sound playing at once. Yeah, I agree, managing which copy to stop would be just the same as manually keeping track of sound copy handles using _SNDCOPY.

What I'm running into is when a level of a game has been completed, for example, all of those copies of sound keep right on humming along with no way to instantly stop them. I try to keep these sound bites very short, a second or less, but even with that it's still difficult to time everything just right for a smooth transition to the next level. If a sound bite is over a second and gets copied a few times then it's completely unmanageable.
There are two ways to write error-free programs; only the third one works.
QB64 Tutorial
Reply


Messages In This Thread
RE: Stopping _SNDPLAYCOPY ?Possible? - by TerryRitchie - 08-07-2024, 04:57 AM
RE: Stopping _SNDPLAYCOPY ?Possible? - by a740g - 08-07-2024, 02:48 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: 19 Guest(s)