Gamestudio Links
Zorro Links
Newest Posts
What are you working on?
by rayp. 10/15/25 20:44
Help!
by VoroneTZ. 10/14/25 05:04
Zorro 2.70
by jcl. 10/13/25 09:01
ZorroGPT
by TipmyPip. 10/12/25 13:58
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 10/11/25 18:45
Reality Check results on my strategy
by dBc. 10/11/25 06:15
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (clonman, AndrewAMD, Quad, TipmyPip), 7,208 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
joenxxx, Jota, krishna, DrissB, James168
19170 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: 52
Caucasus
VoroneTZ Online OP
Junior Member
VoroneTZ  Online OP
Junior Member

Joined: Jun 2008
Posts: 52
Caucasus
Hello!
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

Problem

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: 52
Caucasus
VoroneTZ Online OP
Junior Member
VoroneTZ  Online OP
Junior Member

Joined: Jun 2008
Posts: 52
Caucasus
oh
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 | Zorro platform | shop | Data Protection Policy

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

Powered by UBB.threads™ PHP Forum Software 7.7.1