Hi, forum
I've been wondering about the best way to play background music during a project.
I've read somewhere, in a thread or in the manual, to include the following code in the Global Settings option:
audio_count = 1;
--loads desired audio files into a table
audio = {
"Autoplay\\Audio\\audio1.ogg",
"Autoplay\\Audio\\audio2.ogg",
"Autoplay\\Audio\\audio3.ogg"
};
-- Enter global functions here...
.... and then use the following code in the beginning of the project :
Audio.Load(CHANNEL_BACKGROUND, audio[audio_count], true, false);
-- Insert the following code into the On Audio event of your page:
if e_State == "Finish" then
audio_count = audio_count + 1;
--ensures a valid file will be loaded
if audio_count < Table.Count(audio)+1 then
Audio.Load(CHANNEL_BACKGROUND, audio[audio_count], true, false);
end
end
This indeed works, although, for some reason, it only plays the first music.
But we also have the Audio Setting available, where we can just define a list of different music files as background music.
Any suggestions ?

