I have about 15 .ogg typed - song files for my game. These are all placed in a folder called ’ songs’. I need a script that has connections to all these songs as paths and can play 1 by one randomly, after the previous one just ends. It is perfect also if they have a little bit fading phase between each other.
value SONG should be then an element from a list that is randomly picked… I dont know how to do this, could anyone help me?
import bge import aud musics="songs/" beatmaps="beatmaps/" cdlabels="labels/" device = aud.device() factory = aud.Factory(bge.logic.expandPath("//"+musics+SONG)) factory_buffered = aud.Factory.buffer(factory) handle = device.play(factory_buffered)