Author Topic: Looping/Repeating sound effect  (Read 967 times)

Title says all. I've searched and I can't find any methods on how to set a .wav audio file so it repeats over and over under set conditions.

Just change the sound's description to one of the following.

AudioDefaultLooping3D
AudioCloseLooping3D
AudioClosestLooping3D
AudioLooping2D

Don't think there's any more looping ones.

Just change the sound's description to one of the following.

AudioDefaultLooping3D
AudioCloseLooping3D
AudioClosestLooping3D
AudioLooping2D

Don't think there's any more looping ones.
You won't be able to stop said sounds unless you use alxplay, which would only work on the host client, or if you played the sound on an object using playSound(slot,sound);

You won't be able to stop said sounds unless you use alxplay, which would only work on the host client, or if you played the sound on an object using playSound(slot,sound);
So:

Code: [Select]
datablock AudioProfile(ambientSpace)
{
   filename    = "add-ons/filepath/ambientSpace.wav";
   description = AudioLooping2D;
   preload = true;
};

function playRepeatingSound(%song)
{
   for(%i=0; %i<clientGroup.getCount(); %i++)
   {
      %obj = clientGroup.getObject(%i);
      playSound(%obj, ambientSpace);
   }
}

%obj.playAudio(0,[sound name]);
%obj.stopAudio(0); for when you wish to stop it.

Playing a non-looping sound will also stop it.


Just change the sound's description to one of the following.

AudioDefaultLooping3D
AudioCloseLooping3D
AudioClosestLooping3D
AudioLooping2D

Don't think there's any more looping ones.
AudioMusicLooping3D