Difference between revisions of "Legacy:LoadSound"

From Spherical
Jump to: navigation, search
(See also)
Line 37: Line 37:
==See also==
==See also==
* [[API:Sound.play|Sound.play]]()
* [[API:Sound/play|Sound.play]]()

Latest revision as of 03:03, 20 December 2015



LoadSound(file, streaming);

  • file String. Name of sound file.
  • streaming boolean. Will stream the file from disk instead of loading the full file into memory. Useful for cutting down loading times when you have large sound files.


var sound = LoadSound("sound_effect.ogg");
var music = LoadSound("music.ogg", true);
sound.play(); //Play the sound effect.
music.play(true); //true makes the music loop.


Supported filetypes are:

  • Ogg
  • WAV
  • MP3 (not in minisphere)
  • IT
  • MOD
  • Various other module tracker formats.
  • MIDI (original Sphere only; use is discouraged)

Out of the first three, Ogg is the most recommended format as it's the most widely supported and provides the best size/quality ratio.

Streaming works only for streaming formats like wav, ogg and mp3.

See also