Skip to main content

SoundState

SoundState (Function)​

Format​

soundstate ( player# )

returns integer_expression

Description​

Returns the playback state of a sound instance. player# is the integer id returned by SoundPlayer.

ValueMeaning
0stopped (or finished playing)
1playing
2paused

Example​

music = soundplayer("song.mp3")
soundplay music
while soundstate(music) = 1
pause 0.1
endwhile
print "playback ended"

See Also​

Sound, SoundPause, SoundPlay, SoundPlayer, SoundPosition, SoundStop, SoundWait

Availability​

BASIC-256 2.0 and later. Documented from the BASIC-256 v2.1 continuation project.