Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Sound queries

Maelstrom Janus
Ban Ban Lines !!!
Join date: 4 Jul 2007
Posts: 1,220
02-06-2009 06:50
Hello hoping scripting experts can resolve a couple of queries for me please

1 I'm using a playsound script to make airlocks produce a sound when they're opened or closed... the script plays the sound once. Is there a way of being able to make the sound play more than once when an object is touched ?

2 Possibly not entirely a scripting query but Ive noticed the volume of my wav. files drops considerably when uploaded. The volume setting in the playsound script doesnt seem to make a lot of difference...anything I can do to make my sounds louder ?

Thanks.
_____________________
The Janus Chrononauts - 'Investigate and Explore.'
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
02-06-2009 06:59
I don't think playing sounds multiple times is as simple as it might seem. You probably need to setup a timer to match the duration of the sound clip, and every time the timer event is triggered, play the sound again. You'd obviously need to keep track of how many times the sound had already played, and stop the timer after the last time.

I don't think there's much you can do to increase the volume of your sounds beyond the "volume" parameter in the llPlaySound function. I suspect all the sounds might be normalised when they get uploaded into SL (although I'm not sure), but you could always try just increasing the volume in the file before you upload it. Bear in mind, your position in-world (relative to the sound source) affects the perceived volume (it gets quieter the further away you are).
Maelstrom Janus
Ban Ban Lines !!!
Join date: 4 Jul 2007
Posts: 1,220
02-06-2009 07:09
From: Pedro McMillan
I don't think playing sounds multiple times is as simple as it might seem. You probably need to setup a timer to match the duration of the sound clip, and every time the timer event is triggered, play the sound again. You'd obviously need to keep track of how many times the sound had already played, and stop the timer after the last time.

I don't think there's much you can do to increase the volume of your sounds beyond the "volume" parameter in the llPlaySound function. I suspect all the sounds might be normalised when they get uploaded into SL (although I'm not sure), but you could always try just increasing the volume in the file before you upload it. Bear in mind, your position in-world (relative to the sound source) affects the perceived volume (it gets quieter the further away you are).



Thanks Pedro I have no scripting expertise but somehow manage to bungle through...but going through the help option for scripting hints on sound I couldnt seem to find a way.
(I actually wanted to make an alarm sound repeat several times)
Every time Ive uploaded a sound it seems to dimish -I dont know if others have the problem- the only way I seemed to be able to tackle it was by increasing the volume of a recording before uploading it. I just wondered if there was any other way..
_____________________
The Janus Chrononauts - 'Investigate and Explore.'
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
02-06-2009 07:24
what about using llLoopSound? and use a timer or sleep and use llStopSound. as for the volume there is an llAdjustSoundVolume function, though i've never used it and the wiki doesn't provide much documentation.

http://www.lslwiki.net/lslwiki/wakka.php?wakka=llLoopSound
http://www.lslwiki.net/lslwiki/wakka.php?wakka=llAdjustSoundVolume
http://wiki.secondlife.com/wiki/LlAdjustSoundVolume
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
02-06-2009 09:10
From: Ruthven Willenov
what about using llLoopSound? and use a timer or sleep and use llStopSound. as for the volume there is an llAdjustSoundVolume function, though i've never used it and the wiki doesn't provide much documentation.

http://www.lslwiki.net/lslwiki/wakka.php?wakka=llLoopSound
http://www.lslwiki.net/lslwiki/wakka.php?wakka=llAdjustSoundVolume
http://wiki.secondlife.com/wiki/LlAdjustSoundVolume


llAdjustSoundVolume() retroactively changes the parameter given to llPlaySound() or llLoopSound(), in essence. If a volume of 1.0 isn't loud enough, you're out of luck. Of course, sound volume is decreased based on either the avatar or camera position depending on your preferences, so you might try walking closer and panning your camera closer to see what a large difference that can make. Sometimes when you're zoomed out to admire the visual aspect of your creation, the sound can be a little less striking. ;)
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
02-06-2009 09:23
Also, for reasons that elude me, the size of the object that contains the sound script seems to have an effect on volume. I made a series of clocks a while ago, using Cerra's lovely script to drive them. I have two of the clocks on the sim now. One is a small desk clock and the other is a monster plastered on the side of a building in the town square. When the hour strikes, I can't hear the desk clock beyond the building, but the killer in the town square is audible for a good 80m. Dunno why this should be so, but I'm glad it's not the other way around.:rolleyes:
Moundsa Mayo
Registered User
Join date: 21 May 2007
Posts: 16
02-08-2009 13:29
Maelstrom, you might try multiple sound scripts in the same or linked prims. Trigger them to llPlaySound with a link message. This SEEMS to work in several projects I have scripted.

The sound copies may not ALWAYS be perfectly synchronized at start.

You can also make the sound(s) perceived better (and more loudly by multiple avatars in the airlock) by spreading the scripts apart, say throughout adjacent prims of the build. That's what I have done before in an airlock build for a client.

You can achieve some interesting effects by TRIGGERing a sound multiple times at delays:

float fSoundDelay = 0.01;

llTriggerSound("Sound1", 1.00);
llSleep(fSoundDelay);
llTriggerSound("Sound1", 1.00);
llSleep(fSoundDelay);
llTriggerSound("Sound1", 1.00);
...

Varying the value of fSoundDelay offers a range of effects, as does using different repetition counts. Again, due to SL asynchrony, different executions of this code may produce varied effects.

And using differing sleep durations instead of the same value may be even more 'interesting'. Or not - haven't tried that yet 8^)

Just remember that Triggered sounds stay where the prim was when the sound was Triggered, whereas Played sounds move with the scripted prim.
Taeas Stirling
Registered User
Join date: 4 Sep 2004
Posts: 74
02-08-2009 19:49
best way to maintain the illustion of working hatches is to have your door script play the sound file on opening, then play the same file or a closing file on closing. Most door scripts i have seen all ready have this abuility.
And for aparent loudness, if your on a windows machine just open your sound file in sound recorder, and double the volume or sound level, then re upload it to sl, makes a huge diffrence. While you have the file in sound recorder try reversing it for a closing door effect.
Good luck