Oolite JavaScript Reference: Sound

From Elite Wiki
Revision as of 16:19, 17 September 2009 by Kaks (talk | contribs) (New page: <small>'''Prototype:''' <code>Object</code></small><br /> <small>'''Subtypes:''' SoundSource {{Oolite-class-added|1.71}} The '''Sound''' class is used to play music or sound effects. ==...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

This property was added in Oolite test release 1.70.

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.