Load Background Music

From LuaSTG Wiki
Jump to navigation Jump to search

Load background music node loads a music file into memory. The node will load a music into the game and give it a name.


Parameters[edit | edit source]

Here is a list of parameters of load background music node.

Parameters Function
Path (string without quotations) The relative path to the audio file that need to be loaded. This path follow the same convention as other path parameters in LuaSTG
Resource name (string without quotations) The name that can be used to identify the music after it is loaded
Loop end (number) Starting from the start of the music, the total length of the music played before its first loop backward
Loop length (number) The length from the start of the loop to the end of the music

For resource name, the editor will actually translate it to a string like "bgm:name" with an additional "bgm:" at the beginning, where name is given by Resource name, so attempting to directly use the Resource name as the name of the music will cause an error.


Audio File Format[edit | edit source]

Audio file formats supported by the node are listed below:

  1. .ogg
  2. .wav