Difference between revisions of "Oolite JavaScript Reference: Sound"

From Elite Wiki
(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. ==...)
 
(<code>name</code>)
Line 8: Line 8:
 
== Properties ==
 
== Properties ==
 
=== <code>name</code> ===
 
=== <code>name</code> ===
{{Oolite-prop-added|1.70}}
 
 
  '''name''' : String (read-only)
 
  '''name''' : String (read-only)
 
The file name of the sound file.
 
The file name of the sound file.

Revision as of 15:21, 17 September 2009

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.