I want sounds when avatars interact with my objects.
Here is a script that works for me to create a sound when an object is touched.
Quick Sound Script:
default
{ // this open curly bracket denotes the start of the state state_entry() // an event
{llSay(0, "Watch out!"); }
touch_start(integer total_number) // another event
{llPlaySound("bomb",1.0); }}// end of state entryYOU put in what you want for the words in red
the words that will come out in the chat - "Watch out!"
the name of the sound in the inventory - "bomb441"
You need to make sure the sound is part of the objects inventory. To do this, just drag the sound from your inventory to the contents tab on the object. Follow it with the script. Like this:
(video coming)
A little more technical.
Unless you create your own sounds, you have to download sounds from the web, then upload them into your viewer.
Three things to keep in mind:
1) The sound has to be at 44.1kHz.
You can resave the sound at 44100 Hz using Audacity if it is at a different frequency.
Download Audacity from (it is free):
http://audacity.sourceforge.net/download/
2) The sound has to be less than 10 seconds.
3) A couple of free sources for sounds:
http://www.findsounds.com/ISAPI/search.dll
http://www.wav-sounds.com/
Let me know if you have other free sources of sounds.
So, in this order:
Decide what sound you want.
Locate it on the internet.
Make sure it is 10s or less.
Download it to your desktop. (right-click for pc, opt-command for mac)
Use Audacity to save it at 44.1KHz if it isn't already.
Upload it into your Inventory.
Drag it from your inventory into the contents of the object that is to make the sound.
Drag the premade script or create a script (see above) into the contents of the object.
Save. Test.

No comments:
Post a Comment