Difference between revisions of "Legacy:Sound/pause"

From Spherical
Jump to: navigation, search
(Created the sound.pause page)
 
m
Line 25: Line 25:
 
* Sphere [[API:Sound|Sound]] object
 
* Sphere [[API:Sound|Sound]] object
 
* [[API:Sound/play|Sound.play]](repeat)
 
* [[API:Sound/play|Sound.play]](repeat)
* [[API:Sound/pause|Sound.isPlaying]]()
+
* [[API:Sound/isPlaying|Sound.isPlaying]]()
 
* [[API:Sound/stop|Sound.stop]]()
 
* [[API:Sound/stop|Sound.stop]]()
 
* [[API:AreKeysLeft|AreKeysLeft]]()
 
* [[API:AreKeysLeft|AreKeysLeft]]()

Revision as of 22:00, 20 May 2013

Play a loaded sound.

Usage

sound.pause();


  • sound Sphere Sound object. The sound to pause.

Examples

Pausing a sound with the enter key:

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

my_music.play(false);

while (!IsKeyPressed(KEY_ESCAPE))
{
    while (AreKeysLeft()) {
        if (GetKey() == KEY_ENTER) my_music.pause();
    }
}

See also