Difference between revisions of "Environment Sounds"

From Second Life Wiki
Jump to navigation Jump to search
m
Line 14: Line 14:
You can play a series of sound clips in order, but there's no guarantee that the "song" will be heard as seamless.
You can play a series of sound clips in order, but there's no guarantee that the "song" will be heard as seamless.


=== Looping sounds ===
=== Looping ===


Looping a sound clip can add ambience. Consider it for nighttime bugs by a lake, a crowd murmuring, or the hum of electric signs.
Looping a sound clip can add ambiance. Consider it for nighttime bugs by a lake, a crowd murmuring, or the hum of electric signs.


<lsl>
<lsl>
Line 28: Line 28:
</lsl>
</lsl>


=== Synchronized sounds ===
=== Synchronized ===


Do you want your ocean wave sounds to all synch up? Does your surreal build have a slow steady heartbeat?
Do you want your ocean wave sounds to all synch up? Does your surreal build have a slow steady heartbeat?
Line 34: Line 34:
Try this [[Script:Synch_Sound|synchronized sound script]].
Try this [[Script:Synch_Sound|synchronized sound script]].


=== Random sounds ===
=== Random ===


Short ambient sounds played randomly can make a space feel more alive.  
Short ambient sounds played randomly can make a space feel more alive.  
Line 42: Line 42:
Try this [[Script:Random_Sounds|random sounds script]].
Try this [[Script:Random_Sounds|random sounds script]].


=== Day/Night detection ===
=== Day/Night ===


Some sounds are best played during certain times of day. Consider birdsong, or bats and owls. If your build is taking advantage of a region's natural day/night cycle, you can alter your ambient sound selection by the time of day your region shows.
Some sounds are best played during certain times of day. Consider birdsong, or bats and owls. If your build is taking advantage of a region's natural day/night cycle, you can alter your ambient sound selection by the time of day your region shows.
Line 64: Line 64:
Try this [[Script:Day_Random_Sounds|daytime random sounds script]].
Try this [[Script:Day_Random_Sounds|daytime random sounds script]].


=== Wind activated sounds ===
=== Wind activated ===


Do your bushes rustle more or louder when the wind blows? What about wind chimes?
Do your bushes rustle more or louder when the wind blows? What about wind chimes?
Line 77: Line 77:
Try this [[Script:Wind_Powered_Random_Sounds|wind powered sounds script]].
Try this [[Script:Wind_Powered_Random_Sounds|wind powered sounds script]].


=== Extremely loud sounds ===
=== Loud ===


Using llTriggerSound multiple times in a row can make a sound seem much louder than calling it once. This can be useful for tower bells and explosions. Be careful using this; too many times can cause an unpleasant echo-like effect.
Using llTriggerSound multiple times in a row can make a sound seem much louder than calling it once. This can be useful for tower bells and explosions. Be careful using this; too many times can cause an unpleasant echo-like effect.

Revision as of 11:05, 12 July 2012

Environmental Sounds

There's a handful of ways to generate sound without an avatar in Second Life.

  • Sound clips
  • a parcel's music stream
  • a web page displayed on a prim

You can change all of them using scripting. The latter two depend on the viewer being set properly to allow them to play.

Soundtrack

If your build has a soundtrack or theme music that you want heard clearly across the parcel, consider using streaming music.

You can play a series of sound clips in order, but there's no guarantee that the "song" will be heard as seamless.

Looping

Looping a sound clip can add ambiance. Consider it for nighttime bugs by a lake, a crowd murmuring, or the hum of electric signs.

<lsl> default {

   state_entry()
   {
       llLoopSound( llGetInventoryName( INVENTORY_SOUND, 0 ), 0.5 );
   }

} </lsl>

Synchronized

Do you want your ocean wave sounds to all synch up? Does your surreal build have a slow steady heartbeat?

Try this synchronized sound script.

Random

Short ambient sounds played randomly can make a space feel more alive.

Some good choices for this would be frogs, underbrush rustles and snaps, a distant car horn or squealing brakes.

Try this random sounds script.

Day/Night

Some sounds are best played during certain times of day. Consider birdsong, or bats and owls. If your build is taking advantage of a region's natural day/night cycle, you can alter your ambient sound selection by the time of day your region shows.

<lsl> integer IsSunUp() {

   vector sunPosition = llGetSunDirection();
   return ( sunPosition.z > 0 );

}

integer IsTwilight() {

   vector sunPosition = llGetSunDirection();
   if ( sunPosition.z > 0.0 && sunPosition.z < 0.15 )
       return TRUE;
   return FALSE;

} </lsl>

Try this daytime random sounds script.

Wind activated

Do your bushes rustle more or louder when the wind blows? What about wind chimes?

<lsl> float GetWindStrength() {

   return llVecMag(llWind(ZERO_VECTOR));

} </lsl>

Try this wind powered sounds script.

Loud

Using llTriggerSound multiple times in a row can make a sound seem much louder than calling it once. This can be useful for tower bells and explosions. Be careful using this; too many times can cause an unpleasant echo-like effect.

<lsl> integer n; for (n = 0; n < 5; ++n) {

   llTriggerSound(soundname, 1.0);

} </lsl>