INPStarfall / Starfall

Starfall Processor for Garry's Mod + Wiremod
http://www.wiremod.com/forum/developers-showcase/22739-starfall-processor.html
Other
17 stars 15 forks source link

sounds.create with loop sound without loop #264

Open AlexALX opened 10 years ago

AlexALX commented 10 years ago

You have removed function emitsound, and now we have use sounds.create, but if sound have loop inside - sound playing now infinitely, there is also no function to get sound time, so how i should stop sound with loop if i want play it only once without know sound time? Emitsound was playing any sound only once, even if it has loop.

Xandaros commented 10 years ago

If it loops, it loops. If it doesn't, it doesn't. If you want to loop a non-looping sound, start it again after it finishes. If you don't want to loop a looping sound, stop it after it finishes.

AlexALX commented 10 years ago

Do you understand that if i don't know sound time of looped sound how i can stop it without set this time manually for every sound what i want? And why even i should do this is there was normal function what did exactly what i want? If i have over 20 different sounds to play i need get every sound timing and write stop when i need this? Isn't this is just stupid? Function emitsound was made exactly for this case - i don't need know sound time and can play any sound with loop or not. It always plays only once. If you at least add function for get sound timing then no problem i'll use sounds.create... There is no way to know when loop sound already player more 1 times.

And also why i should to do workarounds in starfall if this feature is in gmod...

awilliamson commented 9 years ago

Didn't read whole text, but if you want the broken, not working sound library back, feel free to go grab it. I find that a working sound library is useful. All sounds are defined and known prior to spawning, you should therefore use a structure that stores the duration as well, the E2 sound browser has the information you require. It's not like you're picking things randomly at run-time or anything.

AlexALX commented 9 years ago
  1. I don't want old sound library, new is better, but it lack simple emitsound function what don't care about loop/non loop sounds.
  2. Storing duration is bad way, because if use server-side code, and stop sound after playing - due to server/client lags you can hear few times on client after it actually stopped on server. This means i need to do sounds on client, but this is just a bit stupid.
  3. Getting information from e2 sound browser and manually do this in starfall code is also stupid.
  4. I'm need this functions for stargate sgc screen projects, where there is much of loop/ non loop sounds. I should use default starfall functions for this, because i don't want include or recommend non-official starfall libraries or repositories for addon players (~40k people).
  5. I really don't want include this function into my starfall library, because it will be weird that emitsound function exists only if installed our addon. So i only want recommend official starfall github and functions.

So instead of argue, this could be 10 times already added - just simple function emitsound for cases what i wrote before.

and sorry for my english.