Game Development Community

Stop sound

by c-level · in Torque Game Engine · 12/11/2003 (7:05 pm) · 5 replies

How do I stop an individual sound?

I play sounds with the following code:

ServerPlay3D(myMusic, %trans);

and know how to stop all sounds:

alxStopAll();


...but at a given time I want to cut off a specific looping sound.


Thanks

#1
12/11/2003 (7:55 pm)
AlxStop(channel);

This will stop a specific sound from playing.
#2
12/12/2003 (10:04 am)
How do I know what the channel will be? Is it different for every sound?

So far, I've used 'ServerPlay3D' in conjunction with making 'audioProfile datablocks', but I have never dealt with a channel.
#3
12/12/2003 (10:22 am)
I've not used ServerPlay3D myself, but heres what i would do to start and stop Mission Music :

%foo = alxPlay(MyAudioProfile);

...

alxStop(%foo);
#4
12/12/2003 (6:18 pm)
To give more detail, I have a vehicle that plays a looping song. When it gets destroyed, the song stops. Well, in my game, it doesn't stop. That's the problem.
I like using 'ServerPlay3D' so that the music sounds like it's coming from that one particular place. For that reason 'alxPlay' doesn't work because it doesn't consider proximity.

Thanks
#5
12/12/2003 (6:52 pm)
As James said :)

%foo = alxPlay(MyAudioProfile);
...alxStop(%foo);