Gamestudio Links
Zorro Links
Newest Posts
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 03/20/23 17:51
Strange error messages in for-loops
by AndrewAMD. 03/20/23 16:21
How can convert mdl7 with UV's?
by l1ve10. 03/20/23 16:13
Asset list - Market Column
by MatPed. 03/20/23 08:44
working with Futures
by logomon. 03/18/23 23:21
AUM Magazine
Latest Screens
SHADOW (2014)
Tactics of World War I
Hecknex World
Who's Online Now
5 registered members (AndrewAMD, YesNotes, paulk, titanicpiano14, l1ve10), 1,389 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
YesNotes, DonQuijote, cokibor, stilrz, unatrader
18906 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
snd_play handle is not freed [SOLVED] #487197
02/08/23 09:11
02/08/23 09:11
Joined: Jun 2008
Posts: 19
VoroneTZ Offline OP
VoroneTZ  Offline OP

Joined: Jun 2008
Posts: 19
I have small game with 3 levels (1 outdoor and 2 interiors, you can change level about 10-15 times for a game)
They have some (from 1 to 5 to level) fire entities with ent_playloop in action
Player action have 2 ent_playloop local handles for water and underwater effect (snd_tune when camera.z<50 for water snd and when camera.z<0 for underwater) and snd_play footsteps\attack sounds
And i have NPC who talk with Player by ent_playsound

All sounds are declared at the header (SOUND* bla-bla-bla, all of them are *.OGG)
all handles are local

I use A8 Pro


When i play about 5 minutes, sounds starts to behave very stange.
If i walk when NPC is talking- NPC sound handle stops after player footstep is sound (or another snd like attack sound)

or another case
i used snd_play for music too
and music was changed every footstep after 5mins
if (!snd_playing(music)){snd_play(new_tack);}
i fix it with using media_play and mp3 tracks, but i want use ent_playsound with NPC dialogs
Anyway, media_play can't play OGG file!

I know about 32 direct play sounds limit, but i try to use:

- add one global handle for all attack sound (mine and npc)
- use snd_stopall(4) before NPC dialog;
- add snd_stop before new footstep sound;
- exit all entity loops and snd_stop all their handles before new level_load (like a fire, underwater, water sounds);
- add if(vec_dist(fire.x,my,x)<500){snd_play}else{snd_stop} for fire action

but it solve my problem partially, and i still have this problem after ~10 minutes of playing (at final scene!)

PLS tell my how can i fix it, or tell me how i need use sounds correcly (maybe i need to use snd_add?)

Last edited by VoroneTZ; 02/08/23 10:16.
Re: snd_play handle is not freed [SOLVED] [Re: VoroneTZ] #487198
02/08/23 09:55
02/08/23 09:55
Joined: Jun 2008
Posts: 19
VoroneTZ Offline OP
VoroneTZ  Offline OP

Joined: Jun 2008
Posts: 19
it's looked what after my manipulations abowe it's really solve my problem, but 2 final npcs conflicted each other with snd_stopall(4)

Moderated by  jcl, Nems, Spirit, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at)

Powered by UBB.threads™ PHP Forum Software 7.7.1