This is the most easy structure, so it comes first.
A SOUND just contains a filename and an intern name.
Create an array named SOUNDS in your GML structure and fill it with entries constructed of the following values:
| Primary | Secondary | Default | Description |
| INTERN | --- | --- | The intern name of the sound, which is used by the interpeter and by scripts. This name has to be unique. |
| FILE | --- | --- | The name of the file which should be played. |
| FOLDER | --- | --- | (OPTIONAL Parameter) The directory containing the sound file. Seen from the directory of "this" GML-file. |
Next: The LOCATIONS structure
As of version 0.7.0, each GML structure has its own parser.
The parser for the sounds is GMLParser_SOUNDS.
Add the parser to your project with:
GMLParser.addParser("SOUNDS",new GMLParser_SOUNDS());
Get the parser for getting values:
var sounds = GMLParser.getParser("SOUNDS").sounds;
As you see, you get the sounds-array from the "SOUNDS" parser.
Each item in this array has the following entries:
| GML Name | Parser value/function (sounds[x].Y) |
| INTERN | getIntern() |
| FILE | soundFile |
| FOLDER | folder |
| ** | audio |
| *** | duration |
The folder-variable contains the FULL path while the FOLDER-tag in GML contains a relative path.
** The audio data loaded from the FILE-name (in the interpreter).
*** The duration of this audio file. (Calculated in the interpreter.)
Next: The LOCATIONS structure
Wiki: GIML_Structure
Wiki: GML_GLOBALS
Wiki: GML_ROOMS
Wiki: Home