Jump to content

Issue with ||LoopSound script


Wallace Wirefly
 Share

You are about to reply to a thread that has been inactive for 4408 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I have used ||LoopSound script many times before in prim to create sound I want in prim on my sim. Recently I notice that when I log off and return to sim the sound no longer plays and I have to reset script to get sound again. Has there been some change made to this code? Before was simple once script was set and 1 sound was added the sound played no issues. I have other prims that seem to do fine. Can anyone give me an idea why not working? Thanks)

Link to comment
Share on other sites

A sound always has to be preloaded before you can hear it play, so you shouldn't hear it the first time it is executed.  You either have to call llPlaySound("sound_file",0.0); to play it at zero volume or call llPreloadSound("sound_file"); and THEN call llPlaySound("sound_file",1.0); or llLoopSound("sound_file",1.0);   This limitation applies to each avatar who hears the sound, so if you have preloaded or played a sound and a new avatar arrives, he will not hear the sound until it has been preloaded or played once for him to hear.  If you don't do that, each person will hear gaps or miss a sound altogether.

One way around the problem is to run a script nearby that scans the area every 20 or 30 seconds for avatars.  If it senses anyone, it triggers a timer event that plays each of your sound files in sequence at zero volume, thus preloading for the new arrival.

Link to comment
Share on other sites

I too noticed problems with sounds that won't load, recently, and heard reports from customers saying the same. I agree, I see a different behaviour here, but don't think that the function have changed, it rather looks like asset server issues, IMHO

Link to comment
Share on other sites

Thanks for reply Rolig. From what I read ||LoopSound plays a sound attached indefinitely. And I have heard the sound many times. Once I log off and return the sound no longer can be heard. Each time i log on I must reset script to hear as long as i stay logged. The idea of scan is good but this adds a lag to sim since it will be constantly scanning. Hopefully can figure out something. Thanks again )

Link to comment
Share on other sites

Yes, llLoopSound plays a sound indefinitely, but each person has to be introduced to it once before he hears it, the same as any other sound.  If you hear a sound, log out, and come back again, you have to go through that preloading stage all over again.  For a looped sound, that means you miss hearing it the first time it plays, every time you relog, and hear it the second time around.  For a single llPlaySound, you miss it entirely. 

I didn't understand from your original post, though, that you aren't hearing the looped sound at all unless you reset it.  That's not the way it's supposed to work, so there's something else going on.  However, I still suggest that one way to beat the problem is to have a slow llSensorRepeat watch to see when people are around, preloading sounds or even restarting the looped sound when a new av arrives on the scene.  I wouldn't get too paranoid about lagging the sim with a sensor that only fires a couple of times a minute.  After all, the alternative is to have your sounds running all the time, even if there's nobody there to hear them.  I'd say the stress on the servers from both options is similar and negligible.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4408 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...