I’m making a song player and would like to point to a folder where all the song files exist and play them direct from there (so I can add / remove files at a later date and not have it mess up anything).
I’ve tried importing the files beforehand but the .arm64 file (I’m writing this for a raspberry pi) grows in size the exact amount of the .wav file, which leads me to believe the song file is getting included in the compilation, which is not what I want.
I’ve also tried putting the files in the user:// folder, but I’m having even more issues with that, as sometimes Godot won’t see the file at all and when it does see it, it won’t be able to play it. (although I’ve found that ProjectSettings.localize_path(~/.local/) doesn’t undo where ProjectSettings.globalize_path(user://) points to, so it might be an issue with that instead).
I have gigabytes of song files I’d like to include, so including them in compilation isn’t really an option. Is there a way to point to a folder and have the processing be done at runtime rather than having to import everything beforehand? Thanks in advance!
Once exported OS.get_executabe_path() will give you the game’s path, then you can load files through a proper loader function for what resource you want. A global path or user path is a good idea.
The documentation says Godot supports importing .ogg files at runtime, and it seems that it only supports .ogg files. Is it possible to import .mp3 and .wav files at runtime? I’ve tried load() but that doesn’t seem to work with files in user:// or global paths. They work fine when I use res:// (because they’re imported at compile time) but when I swap it out for user://, even with identical files in their respective folders, they don’t play.