What it does
LoadMusic writes to a Music object: it loads rather than reads. It takes filename (a string), and answers an integer. That is the first of 2 forms.
Syntax
1
LoadMusic(filename string) → integer2
LoadMusic(musicID integer, filename string)Parameters
| Name | Type | In forms |
|---|---|---|
| filename | string | all |
| musicID | integer | 2 |
What each form returns
| 1 | music = LoadMusic("assets/track.ogg") | integer |
| 2 | LoadMusic(1, "assets/track.ogg") | nothing |
Example · generated
Form 1, the command hands back the id
music = LoadMusic("assets/track.ogg")DO Sync()LOOPForm 2, you choose the id yourself
LoadMusic(1, "assets/track.ogg")DO Sync()LOOPLoadMusic is called and its answer is printed every frame. 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.