Jump to content
aurora1-4

Creating Looped Sounds

Recommended Posts

I am literally posting this because I lost the piece of code and spent hours trying to come up with an alternative.

 

call 
{ 
 _null = [] spawn {for "_i" from 1 to 999 do {       
  playSound3D [getMissionPath "" + "sound\workshop.ogg", e1, false, getPosASL e1, 5, 1, 50];       
  sleep 60;       
 };       
}; 
};   

 

Share this post


Link to post
Share on other sites
2 hours ago, dreadedentity said:

Do you need help with something?

Didn't need it originally. Was just using this as a page to bookmark for when I come back to it in the future.
However, do you know of a way to stop a playSound3D loop half way through a loop.

I wanted to use it for both a generator and a siren.

The generator loop starts from the mission start and has a holdaction to disable it which should stop the sound immediately although, it continues the loop until the sound file is complete. 

The sirens are dependent on the "alive generator". If the sirens are playing and the generator is disabled, then the sirens should also stop immediately, but the same thing happens.
 

Share this post


Link to post
Share on other sites
5 minutes ago, aurora1-4 said:

However, do you know of a way to stop a playSound3D loop half way through a loop.

It has been a while since I've messed with playSound3D so this might be wrong. I think you have to delete the object making the sound to make it stop. If that doesn't work, or isn't an option,  you will have to use say3D which returns the sound source only so you can delete it at will

Share this post


Link to post
Share on other sites
2 minutes ago, dreadedentity said:

It has been a while since I've messed with playSound3D so this might be wrong. I think you have to delete the object making the sound to make it stop. If that doesn't work, or isn't an option,  you will have to use say3D which returns the sound source only so you can delete it at will

Yeah, I thought the same also. 
Tried deleting the object but the sound continued, strangely. 

The sound files are pretty short anyway so i'm content with how it currently is. 
Thanks anyway though!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×