Legacy:Sound/stop

From Spherical
< Legacy:Sound
Revision as of 22:03, 20 May 2013 by Radnen (talk | contribs) (Creates sound.stop page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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