Sound: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{feature|1|0.3.54| |Sound1.png| }} | {{feature|1|0.3.54| |Sound1.png| }} | ||
The '''sound''' command | The '''sound''' and '''noise''' commands play sounds. The '''sound''' command uses 3D positioning of the sound. | ||
{{Clear}} | {{Clear}} | ||
==Usage== | ==Usage== | ||
'''sound''' url [''loop | noloop''] [''global''] [''radius=''] [''volume=''] | 3D positioned sound: | ||
'''sound''' url [''loop | noloop''] [''global''] [''radius=''] [''volume=''] [leftspk=''name''] [rightspk=''name''] | |||
2D sound: | |||
'''noise''' url [''loop | noloop''] [''global''] [''volume=''] | |||
==Arguments== | ==Arguments== | ||
; url : | ; url : The name of a sound in the /sounds folder on the world's object path, or a URL on a remote server. Supported formats are Opus, Ogg Vorbis, PCM WAV files (Mono, Stereo, 8 and 16-bit). | ||
; loop | noloop: | ; loop | noloop: Enables or disables looping of the sound. For ''sound'' looping is disabled by default, for ''noise'' looping is disabled by default. | ||
; global : This will cause the sound to be played for all users within view of the object, otherwise it will play only for the user who initiated the event. Global is per command, not per trigger. | ; global : This will cause the sound to be played for all users within view of the object, otherwise it will play only for the user who initiated the event. Global is per command, not per trigger. | ||
; radius : Changes the radius that the sound will play in.<br />'''Prerequisites:''' version 0.3.60<br />'''Values:''' Decimal numbers greater than 0.0<br />'''Default:''' 50 | ; radius : Changes the radius that the sound will play in, the default is 50 meters. <br />'''Prerequisites:''' version 0.3.60<br />'''Values:''' Decimal numbers greater than 0.0<br />'''Default:''' 50 | ||
; volume : Changes the volume at which the sound will play.<br />'''Prerequisites:''' version 0.3.55<br />'''Values:''' Decimal numbers between 0.0 and 1.0<br />'''Default:''' 1.0 | ; volume : Changes the volume at which the sound will play.<br />'''Prerequisites:''' version 0.3.55<br />'''Values:''' Decimal numbers between 0.0 and 1.0<br />'''Default:''' 1.0 | ||
; leftspk : positions the left channel of a stereo sound at a named object<br /> '''Prerequisites:''' version 0.3.58 | |||
; rightspk : positions the right channel of a stereo sound at a named object<br /> '''Prerequisites:''' version 0.3.58 | |||
== | ==Examples== | ||
create sound sound.wav loop | create sound sound.wav loop | ||
Line 21: | Line 26: | ||
: User who clicked hears music.wav, others hear sound.wav | : User who clicked hears music.wav, others hear sound.wav | ||
create sound waterf1; | |||
activate sound volume=0.1 | |||
: A looped waterfall sound starts playing when object loads. When the object is clicked the volume of the playing sound is lowered to 10%. | |||
activate noise deport1 | |||
: When the object is clicked a teleport sound is played once, no 3D positioning will be used for this sound. | |||
{{Build}} | {{Build}} | ||
[[Category: Script commands]] | [[Category: Script commands]] |
Latest revision as of 20:42, 26 August 2017
Sound | ||
---|---|---|
Build required | 1 | |
Version required | 0.3.54 |
The sound and noise commands play sounds. The sound command uses 3D positioning of the sound.
Usage
3D positioned sound:
sound url [loop | noloop] [global] [radius=] [volume=] [leftspk=name] [rightspk=name]
2D sound:
noise url [loop | noloop] [global] [volume=]
Arguments
- url
- The name of a sound in the /sounds folder on the world's object path, or a URL on a remote server. Supported formats are Opus, Ogg Vorbis, PCM WAV files (Mono, Stereo, 8 and 16-bit).
- loop | noloop
- Enables or disables looping of the sound. For sound looping is disabled by default, for noise looping is disabled by default.
- global
- This will cause the sound to be played for all users within view of the object, otherwise it will play only for the user who initiated the event. Global is per command, not per trigger.
- radius
- Changes the radius that the sound will play in, the default is 50 meters.
Prerequisites: version 0.3.60
Values: Decimal numbers greater than 0.0
Default: 50 - volume
- Changes the volume at which the sound will play.
Prerequisites: version 0.3.55
Values: Decimal numbers between 0.0 and 1.0
Default: 1.0 - leftspk
- positions the left channel of a stereo sound at a named object
Prerequisites: version 0.3.58 - rightspk
- positions the right channel of a stereo sound at a named object
Prerequisites: version 0.3.58
Examples
create sound sound.wav loop
- The file sound.wav is retrieved from the object path sounds folder, and played over and over, though loop is superfluous
activate sound sound.wav global, sound music.wav
- User who clicked hears music.wav, others hear sound.wav
create sound waterf1; activate sound volume=0.1
- A looped waterfall sound starts playing when object loads. When the object is clicked the volume of the playing sound is lowered to 10%.
activate noise deport1
- When the object is clicked a teleport sound is played once, no 3D positioning will be used for this sound.
|
|
Triggers: |
|
Commands: |
Animate • Animation • Ambient • Camera • Color • Diffuse • Frame • Framerate • Group • Light • Move • Name • Noise • Normalmap • Opacity • Path • Picture • Rotate • Say • Shear • Scale • Sign • Solid • Sound • Specular • Specularmap • Teleport • Teleportx • Teleportxyz • Texture • Url • Visible • Web |