What it does
LoadSound writes to a Sound object: it loads rather than reads. It takes soundID (an integer) and filename (a string), and returns nothing. That is the first of 2 forms. soundID is the id you are giving a Sound object: every later call names it by that number.
Syntax
1
LoadSound(soundID integer, filename string)2
LoadSound(filename string) → integerParameters
| Name | Type | In forms |
|---|---|---|
| soundID | integer | 1 |
| filename | string | all |
What each form returns
| 1 | LoadSound(1, "assets/sound.wav") | nothing |
| 2 | sound = LoadSound("assets/sound.wav") | integer |
Example · generated
Form 1, you choose the id yourself
LoadSound(1, "assets/sound.wav")DO Sync()LOOPForm 2, the command hands back the id
sound = LoadSound("assets/sound.wav")DO Sync()LOOPLoadSound 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.