Game Development Community

Sound problems

by Roberto Varela · in Torque Game Engine · 10/11/2007 (9:41 am) · 2 replies

Hi!

I'm having a strange bug related with sound.
Sometimes the sound keeps playing even after I called alxStop();

I have declared something like this:

datablock AudioDescription(AudioClosestLooping3d)
{
volume = 1.0;
isLooping= true;

is3D = true;
ReferenceDistance= 5.0;
MaxDistance= 20.0;
type = $SimAudioType;
};

datablock AudioProfile(RabbitAttackSound)
{
filename = "~/data/sound/npc_rabbit_attack1.wav";
description = AudioClosestLooping3d;
preload = true;
};


When the rabbit attacks I'm doing %rabbit.attackSoundHandle = alxPlay(RabbitAttackSound);
When it stop attacking I'm calling alxStop(%rabbit.attackSoundHandle);

I have confirmed and for each alxPlay I'm calling alxStop...


Anyone have the same problem?
Any clue about what could cause this strange behavior?


Thanks!

About the author

Recent Threads


#1
10/19/2007 (7:43 am)
I've been debugging inside the Torque code...

It appears that when I call alxPlay with a looping sound and is3D=true and the volume calculations is zero (the sound is played near the MaxDistance) the handle returned by alxPlay is valid but useless when I call alxStop...

Anyone, can help me with this?


Thank you!
#2
10/25/2007 (5:45 am)
Why dont you use serverPlay3D for the attack sound ? I'am not sure but alxplay is better for 2d sound since you have no location where to play this sound.