LoadMusicOgg

Family: Music · 2 forms

What it does

LoadMusicOgg loads OGG on a Music object. It takes filename (a string), and answers an integer. That is the first of 2 forms.

Syntax

1
LoadMusicOgg(filename string) → integer
2
LoadMusicOgg(musicID integer, filename string)

Parameters

NameTypeIn forms
filenamestringall
musicIDinteger2

What each form returns

1musicOgg = LoadMusicOgg("assets/track.ogg")integer
2LoadMusicOgg(1, "assets/track.ogg")nothing

Example · generated

Form 1, the command hands back the id

musicOgg = LoadMusicOgg("assets/track.ogg")DO  Sync()LOOP

Form 2, you choose the id yourself

LoadMusicOgg(1, "assets/track.ogg")DO  Sync()LOOP

LoadMusicOgg 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.

Related commands

29 commands in Music