Game Development Community

Adding and deleting 3d sound runtime problem

by SaurabhTorne · in Torque Game Engine · 02/08/2007 (7:05 am) · 3 replies

I have a 3d looping audio profile.
datablock AudioProfile(Sound1)
{
   filename = "~/data/sound/fll.wav";
   description = AudioClosestLooping3d;
	preload = true;
	//enableVisualFeedback = true;
};

Now I am creating its object at a position and trying to get its handle to store in a group

%Sound = alxPlay(sound1,%pos);

The problem is %Sound not giving the handle . Is there something wrong. echo(%sound) gives junk number

#1
02/08/2007 (7:13 am)
The number is the soundHandle also position syntax is alxPlay( profile , x , y , z )
#2
02/08/2007 (8:19 am)
%Sound = alxPlay(Sound1,getword(%Pos,0),getword(%Pos,1),getword(%Pos,2));

the audio object was created in both cases but the %sound does not release a positive integer. instead it gives a negative junk number like -293849xxx. I need to delete the audio emitter later at runtime so i was gonna store the handle to the audio object.

does alxstop() and alxstopall() delete the audio emiter object or the objet stays.
#3
02/09/2007 (4:59 am)
Make %sound a global $sound if you not pass the %sound around.
Then to stop the sound you only need alxstop(handle).