Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (1 invisible), 672 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 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
Russia\Georgia
VoroneTZ Offline OP
Newbie
VoroneTZ  Offline OP
Newbie

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

Joined: Jun 2008
Posts: 30
Russia\Georgia
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 | chip programmers | 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