The Sound Command


Usage

    sound URL [loop OR noloop] [name=name]

Description

Note: the sound command has been extended in Outerworlds 3.1. The new extensions (noted below) require 3.1 or later in order to function.

The sound command attaches a background sound to the object on which it was placed. The sound can be either a WAV file, a MIDI file, or, beginning with Outerworlds 3.1, a MP3 file. Outerworlds only plays a single background sound at a time; if there are multiple background sounds active in a scene, the sound of the closest object plays. The volume and left/right panning of the sound are adjusted depending on the distance and direction of the object from the user.

URL can either be the name of a sound local to that world (i.e. a sound located in the "sound" folder of the world's object path) or it can be an absolute URL to a .wav, .mid, or .mp3 file on the World Wide Web.

The optional loop and noloop flags indicate whether the sound is played once or loops indefinitely. The default is loop for .wav files and .mp3 files, and noloop for .mid files. The loop and noloop flags are new in Outerworlds 3.1 and will not be understood by earlier versions of Outerworlds.

The optional name argument specifies the name of another nearby object to attach the sound to. The name argument is new in 3.1 and will not be understood by earlier versions of Outerworlds.

Note that when linking to absolute URLs, maximum size limits may apply.

See MP3 support for more on using MP3 files in Outerworlds.

Examples

    create sound atmos1.mid

This creates an object which will play the MIDI file "atmos1.mid" whenever a user approaches it. Note that since this is a "local" sound, atmos1.mid must be present in the "sounds" directory of the world's object path as "atmos1.zip" in order to play.

    create sound http://www.myisp.com/myaccount/mysong.mp3

This creates an object which will download and play the MP3 file "mysong.mp3" from the web whenever a user approaches it.

See also the noise command.