Oolite JavaScript Reference: Sound

From Elite Wiki
Revision as of 15:21, 17 September 2009 by Kaks (talk | contribs) (<code>name</code>)

Prototype: Object
Subtypes: SoundSource

This class was added in Oolite test release 1.71.

The Sound class is used to play music or sound effects.

Properties

name

name : String (read-only)

The file name of the sound file.

Methods

load

function load(soundFile : String)

Loads a music file to memory, to avoid stutter on playback.

playMusic

function playMusic(soundFile : String)

Starts playing the sound file. Stops upon reaching the end of the sound file.

stopMusic

function stopMusic([soundFile : String])

Stops the specified sound file from playing. If no file is specified, stops all music.