I've gotten my MonoGame/Android game to the point where I can preload a bunch of audios before-hand (this avoids weird behaviour where the sound is not ready at the instant of need). I do this by doing something like:
string[] audioFiles = new string[] { "game-over", "hit", ... }
foreach (string audio in audioFiles) {
someContentManager.Load<SoundEffect>("Audio/" + audio);
}
The problem is that this requires manually listing all of the files. I would like to somehow read the directory contents.
I tried various combinations of Directory.GetFiles. I can list out the contents of /, but that doesn't help me at all.
How can I dynamically read/load the contents of a certain directory?