Author Topic: Stop a looping sound  (Read 1459 times)

I have a looping sound (AudioClosestLooping2d) audioprofile set to play, however I have no idea how to make it actually stop, and I've found nothing on how to stop it.

Code for the audioprofile is:
Code: [Select]
datablock AudioProfile(Blizzard_WinterWind)
{
    fileName = "./WinterWind.wav";
    description = AudioClosestLooping2d;
    preload = false;
};

What code you using to play it?

Just the regular serverplay2d function. Does it matter?

Just the regular serverplay2d function. Does it matter?
well I know theres a way to stop it client sidedly

Just the regular serverplay2d function. Does it matter?
if it's playing from an object using some kind of method like play3d or something then it's assigned to a slot and you can stop it

if it's playing from an object using some kind of method like play3d or something then it's assigned to a slot and you can stop it
Well as was said before this is a 2d sound meant to be played and heard the same server-wide. Is there any way to stop THAT?

Well as was said before this is a 2d sound meant to be played and heard the same server-wide. Is there any way to stop THAT?
No.

But you could use a looping function. That could work, so then if you have like $StopTheLoop = 1;, then the loop would stop, and the sound would stop playing.

No.

But you could use a looping function. That could work, so then if you have like $StopTheLoop = 1;, then the loop would stop, and the sound would stop playing.

Lol..

Lol..
What's wrong with his example exactly? I see no problem with it.

You could also make a function that loops, and another function that cancels the schedule of the looping function

Use a AudioEmitter object and delete it to stop the sound, or use Player::playSound with Player::stopSound.