If you are exporting your audio files wouldn’t load("res://example.wav") work?
var soundinstance := AudioStreamPlayer.new()
add_child(soundinstance)
soundinstance.stream = load(sound)
Interesting config file reading though, could be useful if you do not have the full path of the resource and need to get it dynamically, though 4.4 should fix this with ResourceLoader.list_directory
Yes the .remap/.import problem is tough, usually comes up when one tries to dynamically load filepaths, like picking a random song from a folder, especially a folder that is added to by DLC or mods; but load takes normal “res://” paths just as preload does.
I was trying to play sounds on runtime, first I just called AudioStreamWAV.load_from_file(sound) thing to soundinstance.stream, but that didn’t work. I’ve spent a lot of time figuring out the actual way to do that (and on the internet there was literally NO solution I needed). After a while I looked up in exported runnable file through GDRE and found that in .godot/imported there were still files I was looking for. So I just parsed the real path to them, and then a lot of time was wasted on making the files actually play from those paths. When I was testing it, the autocompletion suggested something called “ResourceLoader”, and that how I’ve got here.
I see, yeah AudioStreamWAV.load_from_file does work in-development because the raw wav file exists in your project directory, but it’s converted/remapped on export.
AudioStreamWAV.load_from_file is for dynamically loading files, such as user content like if you wanted to play a random song from a folder in “user://” or any file on the player’s disk. load/preload is for loading packed files, generally anything in “res://” exported or in-development should work.