Legacy:Sound/stop

From Spherical
Revision as of 22:39, 30 May 2013 by Apollolux (talk | contribs) (navboxed)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Play a loaded sound.

Usage

sound.stop();


  • sound Sphere Sound object. The sound to stop.

Examples

Stopping and playing sound with the enter key:

var my_music = LoadSound("your_sound.ogg");
var toggle = false;

my_music.play(true);

while (!IsKeyPressed(KEY_ESCAPE))
{
    while (AreKeysLeft()) {
        if (GetKey() == KEY_ENTER) toggle ? my_music.play() : my_music.stop();
    }
}

Notice the above is different from pause which will continue where you left off.

See also


API:Sound/navbox