CSoundPatch.PlayEx problem with playing loop sound on some pc's
0 replies, posted
Hello all, sorry for my bad english.
I'm developer of addon "Stargate with Group System" - [url]http://facepunch.com/threads/1163292[/url]
And some users have very strange problem, what i can't detect and fix.
I'm not going to talk about this addon and immediately turn to the case, but this is hard to explain, so i just show video what send one of users what have this problem.
[video=youtube;8oVcGcr7O94]http://www.youtube.com/watch?v=8oVcGcr7O94[/video]
So, like you see, this user have bug with sound, some other users also have same problem. But i havn't it on my pc's, and can't understand why this happens for some users.
Code of this sound is:
[PHP]-- Sounds
ENT.Sounds = {
Slow=Sound("AlexALX/stargate/gate_roll_long.wav"),
...other sounds here...
}
function ENT:ActivateRingSound(pitch)
util.PrecacheSound(self.Sounds.Slow);
self.RingSound = CreateSound(self.Entity, self.Sounds.Slow);
self.RingSound:ChangePitch(pitch);
self.RingSound:SetSoundLevel(94);
self.RingSound:PlayEx(1,pitch);
end[/PHP]
So this is small function, what playing wav file with loop, and i call it, when i need activate sound.
For example, activate code:
[PHP]local pitch = 97;
self:ActivateRingSound(pitch);[/PHP]
And stop code:
[PHP] if (self.RingSound) then
self.RingSound:Stop();
end[/PHP]
All works fine on my pc's (tested on few pc's with different os and configs). But some users have bug with this sound like you see before. Also this bug happens only in singleplayer, if start multiplayer - sound works fine.
Why this can happen? Maybe someone can explain what wrong or help with this bug? I really can't understand what wrong and how fix it...
Sorry, you need to Log In to post a reply to this thread.