Gamestudio Links
Zorro Links
Newest Posts
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
Who's Online Now
2 registered members (Quad, AndrewAMD), 410 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 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: 30
VoroneTZ Offline OP
VoroneTZ  Offline OP

Joined: Jun 2008
Posts: 30
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: 30
VoroneTZ Offline OP
VoroneTZ  Offline OP

Joined: Jun 2008
Posts: 30
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