Add music features on sol.audio to allow more control on loops
Created by: Renkineko
When you want to loop an ogg music on a certain time, you can't so you have to cheat. One solution is to do it with two music : when the first (the intro) stops, you play the second. The only way to do it now is to use a timer, which lack of precision.
There is two way to enhance the way the engine play musics (because SPC and IT files are not very common or easy to create, unlike using free and open musics downloaded on FLAC or MP3 format and converted to OGG) :
- add a function "sol.audio.add_queue(music)", behavior expected : when the current music reach the end, instead of loop on the same music, it plays the second and the loop go on the second file only. Pros : easy to use in my opinion.
- add an event "sol.audio.on_music_finished()", triggered when the music reach the end. Pros : can be used to another thing than just a changing music (I don't have any example really relevant, but it could play another sound like a screaming monster or a cracking wall/floor, or stop a timer in a sound based enigma...)