PlayMusic

Family: Music · 4 forms

What it does

PlayMusic makes something happen at once: it plays. It takes no arguments, and returns nothing. That is the first of 4 forms.

Syntax

1
PlayMusic()
2
PlayMusic(musicID integer)
3
PlayMusic(musicID integer, loop integer)
4
PlayMusic(musicID integer, loop integer, startID integer, endID integer)

Parameters

NameTypeIn forms
musicIDinteger2, 3, 4
loopinteger3, 4
startIDinteger4
endIDinteger4

Every form returns

nothing

Example · generated

Form 1, the short one

PlayMusic()DO  Sync()LOOP

Form 4, with every argument

music = LoadMusic("assets/track.ogg")PlayMusic(music, 1, 1, 1)DO  Sync()LOOP

PlayMusic is called with values of the types its signature asks for. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.

Related commands

29 commands in Music